Iv. conclusion of the experiment
Programming Exercises (1)
Source:
/*Enter an integer of 1~7, or output "workday" if the input is a delivery. Let's work hard "; If you enter 6~7, the output is" weekend. Let ' s has a rest. "*/#include<iostream>using namespacestd;intMain () {intDay ; CIN>>Day ; if(day>=1&&day<=5) cout<<"Workday. let's work hard."; if(day==6|| day==7) cout<<"weekend. Let ' s has a rest." ; return 0;}
Operation Result:
Programming Exercises (2)
Source:
/*Enter an integer to invert the numbers and output. (for example, enter 365, output 563.) In the implementation of example 2-6, the 5-6-3 is output one by three times, which requires that 563 be output as a total number. )*/#include<iostream>using namespacestd;intMain () {intNintm=0; CIN>>N; while(n) {m=m*Ten+n%Ten; N=n/Ten; } cout<<m; return 0;}
Operation Result:
Five, the experiment summary and experience
The experiment is still used in the last semester to learn the C language solution, just to familiarize yourself with C + + code format and input and output statements.
C + + Simple programming-1