You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
#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;
|
|
}
|