c++实验一

1.
 #include<iostream>
using namespace std;
int main(){
int day;
cin>>day;
if(day>0&&day<6)
cout<<"workday.Let's work hard"<<endl;
else
cout<<"weekend.Let's have a rest"<<endl;
return 0;
}

 

2.

 #include<iostream>
using namespace std;
int main(){
int n,newnum=0;
cin>>n;
while(n>0)
{
newnum=newnum*10+n%10;
n=n/10;
}
cout<<newnum<<endl;
return 0;
}

 

posted @ 2018-03-16 17:03  不见曦月  阅读(114)  评论(0编辑  收藏  举报