cpp实验一,cpp实验

cpp实验一,cpp实验

#include<iostream>
using namespace std;
int main()
{
int a;
cin>>a;
switch(a)
{
case(1):
case(2):
case(3):
case(4):
case(5):
cout<<“workday.Let’s work hard”;
break;
case(6):
case(7):
cout<<“weekday.Let’s have a rest”;
default:
cout<<“invalid input” ;
}
return 0;
}图片 1

 

#include<iostream>

using namespace std;
int main()
{
int a,n=0;
cin >> a;
while (a>0)
{
n=n*10+a%10;
a=a/10;
}
cout<<n;
return 0;
}
图片 2

 

#includeiostream using
namespace std; int main() { int a; cina; switch(a) { case(1): case(2):
case(3): case(4): case(5): cout”workday.Let’s work hard”; bre…

相关文章