ifstream rf("in.txt",ios::in);
ofstream wf("out.txt",ios::out);
int n,x;
for (int i=0; i<10; i++){
rf>>x>>n;
wf<
#include
using namespace std;
void wwff();
long myfun(int x,int n)
{
/**********Program**********/
long z=1.0;
int i;
for(i=0;iifstream rf("in.txt",ios::in);
int n,x;
rf>>x>>n;
ofstream wf("out.txt",ios::out);
wf<
#include
using namespace std;
int countWeek(int week, int n)
{
/**********Program**********/
int w;
w=(week+n)%7;
return w;
/**********
End **********/
}
void grading();
int main()
{
int tWeek, n;
cout <<"请输入当天的星期(星期日:0,星期一:1,......)";
cin >> tWeek;
cout << "请输入要计算的星期是多少天后的:";
cin >> n;
cout <n << "天后是星期一\n";
n << "天后是星期二\n";
n << "天后是星期三\n";
n << "天后是星期四\n";
n << "天后是星期五\n";
n << "天后是星期六\n";
cout <<
break;
case 2:
cout <<
break;
case 3:
cout <<
break;
case 4:
cout <<
break;
case 5:
cout <<
break;
case 6:
cout <<
break;
default:
cout<<"错误!";
break;
grading();
return 0;
}
void grading()
{
fstream myfile;
myfile.open("out169.txt",ios::out);
myfile << countWeek(0,20);
myfile << countWeek(1,30);
myfile << countWeek(6,40);
myfile << countWeek(3,300) << endl;
myfile << countWeek(4,12);
myfile << countWeek(5,43);
myfile << countWeek(0,1503) << endl;
myfile.close();
}
6、
/*------------------------------------------------
【程序设计】
--------------------------------------------------
题目: 完成下面函数 reverse 的编写,该函数将数组 a 中的
所有元素逆序排列,参数 len 是数组 a 中元素的个