'commit'
This commit is contained in:
22
C++课程/第十一课分支结构程序设计/p86.cpp
Normal file
22
C++课程/第十一课分支结构程序设计/p86.cpp
Normal file
@@ -0,0 +1,22 @@
|
||||
#include<iostream>
|
||||
using namespace std;
|
||||
int main() {
|
||||
int n;
|
||||
cout<<"n=";
|
||||
cin>>n;
|
||||
switch(n) {
|
||||
case 1:
|
||||
cout<<"f=n"<<endl;
|
||||
break;
|
||||
case 2:
|
||||
cout<<"f=n*n"<<endl;
|
||||
break;
|
||||
case 3:
|
||||
cout<<"f=n*n*n"<<endl;
|
||||
break;
|
||||
default:
|
||||
cout<<"f=0";
|
||||
break;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
Reference in New Issue
Block a user