#include<iostream> using namespace std; int main() { int day; cin>>day; switch(day) { case 1: cout<<"workday.Let‘s work hard"<<endl; break; case 2: cout<<"workday.Let‘s work hard"<<endl; break; case 3: cout<<"workday.Let‘s work hard"<<endl; break; case 4: cout<<"workday.Let‘s work hard"<<endl; break; case 5: cout<<"workday.Let‘s work hard"<<endl; break; case 6: cout<<"weekend.Let‘s have a rest"<<endl; break; case 7: cout<<"weekend.Let‘s have a rest"<<endl; break; } return 0; }
#include<iostream> using namespace std; int main() { int n,b,c=0; cout<<"Enter the number:"; cin>>n; do{ b=n%10; c=c*10+b; n/=10; } while(n!=0); cout<<c; cout<<endl; return 0; }
实验总结与分析:
通过这个实验,让我熟悉了许多算法。