造数据

用程序造数据
第一步

#include <bits/stdc++.h>
using namespace std;
int main()
{
   
       freopen("F:\\工作室\\造数据\\test1.in","w",stdout);//设置 cout printf 这些输出流都输出到 test.in里面去
       for(int i=7;i<=1e7;i++)
        cout<<rand()<<endl;//随机生成10000个数
       return 0;
}

第二步

#include<bits/stdc++.h>
using namespace std;
int main()
{
   
    freopen("F:\\工作室\\造数据\\test1.in","r",stdin);
    freopen("F:\\工作室\\造数据\\test1.out","w",stdout);
    int t;
    int sum;
    while(cin>>t)
    {
   
        sum=t/7;
        if(t%7!=0)
            sum++;
        cout<<sum<<endl;
    }
    return 0;
}
全部评论

相关推荐

2025-12-28 22:19
门头沟学院 Java
不敢追165女神:简历写得毫无特点,你说你要是大二或者大三找寒假实习到暑期实习这段时间,你的简历还能约到面试。但是你是研究生哥,面试官不会因为你是研究生而降低要求,反而会觉得你是研究生才学了这么一点?为什么我不找个同阶段的本科生?
简历中的项目经历要怎么写
点赞 评论 收藏
分享
2025-12-13 14:51
已编辑
井冈山大学 算法工程师
龙虾x:算法比你强的没有你美,比你美的…..算了已经没有比你美的了
工作两年想退休了
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务