返回列表 發帖

五則運算(一)

  1. #include<iostream>
  2. #include<cstdlib>
  3. using namespace std;
  4. int main()
  5. {
  6.     int x=10, y=3;
  7.     cout<<"當x等於"<<x<<", y等於"<<y<<"時..."<<endl;
  8.     cout<<"x+y="<<x+y<<endl;
  9.     cout<<"x-y="<<x-y<<endl;
  10.     cout<<"x*y="<<x*y<<endl;
  11.     cout<<"x/y="<<x/y<<endl;
  12.     cout<<"x%y="<<x%y<<endl;
  13.     system("pause");
  14.     return 0;   
  15. }
複製代碼

  1. #include<iostream>
  2. #include<cstdlib>
  3. using namespace std;
  4. int main()
  5. {
  6.     int X=10,Y=3;
  7.     cout<<"當X的質為"<<X<<",Y的質為"<<Y<<"時....."<<endl;
  8.     cout<<"X+Y="<<X+Y<<endl;
  9.     cout<<"X-Y="<<X-Y<<endl;
  10.     cout<<"X*Y="<<X*Y<<endl;
  11.     cout<<"X/Y="<<X/Y<<endl;
  12.     cout<<"X%Y="<<X%Y<<endl;
  13.     system("pause");
  14.     return 0;   
  15.    
  16. }
複製代碼

TOP

  1. #include<iostream>
  2. #include<cstdlib>
  3. using namespace std;
  4. int main()
  5. {
  6.   int x=500,y=10;
  7.   cout<<"當X="<<x<<",y="<<y<<"時:"<<endl;
  8.   cout<<"x+y="<<x+y<<endl;
  9.   cout<<"x-y="<<x-y<<endl;
  10.   cout<<"x*y="<<x*y<<endl;
  11.   cout<<"x/y="<<x/y<<endl;
  12.   cout<<"x%y="<<x%y<<endl;
  13.   system("pause");   
  14.   return 0;
  15. }
複製代碼

TOP

  1. #include<iostream>
  2. #include<cstdlib>
  3. using namespace std;
  4. int main()
  5. {
  6.     int x=10,y=3;
  7.     cout<<"當x等於"<<x<<", y等於"<<y<<"時..."<<endl;
  8.     cout<<"x+y= "<<x+y<<endl;
  9.     cout<<"x-y= "<<x-y<<endl;
  10.     cout<<"x*y= "<<x*y<<endl;
  11.     cout<<"x/y= "<<x/y<<endl;
  12.     cout<<"x%y= "<<x%y<<endl;
  13.     system("pause");
  14.     return 0;
  15. }
複製代碼
回復 1# 陳品肇

TOP

  1. #include<iostream>
  2. #include<cstdlib>
  3. using namespace std;
  4. int main()
  5. {
  6.     int a=23,b=15;
  7.     cout<<"a+b="<<a+b<<"\n";
  8.     cout<<"a-b="<<a-b<<"\n";
  9.     cout<<"a*b="<<a*b<<"\n";
  10.     cout<<"a/b="<<a/b<<"\n";
  11.     cout<<"a%b="<<a%b<<"\n";
  12.     system("pause");
  13.     return 0;   
  14.    
  15. }
複製代碼

TOP

  1. #include<iostream>
  2. #include<cstdlib>
  3. using namespace std;
  4. int main()
  5. {
  6.     int x=10,y=3;
  7.     cout<<"當x等於"<<x<<",y等於"<<y<<"時..."<<endl;
  8.     cout<<"x+y="<<x+y<<endl;
  9.     cout<<"x-y="<<x-y<<endl;
  10.     cout<<"x*y="<<x*y<<endl;
  11.     cout<<"x/y="<<x/y<<endl;
  12.     cout<<"x%y="<<x%y<<endl;
  13.    system("pause");
  14.     return 0;
  15.     }
複製代碼

TOP

  1. #include<iostream>
  2. #include<cstdlib>
  3. using namespace std;
  4. int main()
  5. {
  6.     int x=10, y=3;
  7.     cout<<"當x等於"<<x<<", y等於"<<y<<"時..."<<endl;
  8.     cout<<"x+y="<<x+y<<endl;
  9.     cout<<"x-y="<<x-y<<endl;
  10.     cout<<"x*y="<<x*y<<endl;
  11.     cout<<"x/y="<<x/y<<endl;
  12.     cout<<"x%y="<<x%y<<endl;
  13.     system("pause");
  14.     return 0;   
  15. }
複製代碼

TOP

  1. #include<iostream>
  2. #include<cstdlib>
  3. using namespace std;
  4. int main()
  5. {
  6.     int a=10,b=4;
  7.     cout<<"當a="<<a<<",b="<<b<<"時"<<endl;
  8.     cout<<"a+b="<<a+b<<endl;
  9.     cout<<"a-b="<<a-b<<endl;
  10.     cout<<"a*b="<<a*b<<endl;
  11.     cout<<"a/b="<<a/b<<endl;
  12.     cout<<"a%b="<<a%b<<endl;
  13.     system("pause");
  14.     return 0;
  15.    
  16.    
  17. }
複製代碼

TOP

  1. #include<iostream>
  2. #include<cstdlib>
  3. using namespace std;
  4. int main()
  5. {
  6.     int x=10,y=3;
  7.     cout<<"當x等於"<<x<<",y等於"<<y<<"時..."<<endl;
  8.     cout<<"x+y="<<x+y<<endl;
  9.     cout<<"x-y="<<x-y<<endl;
  10.     cout<<"x*y="<<x*y<<endl;
  11.     cout<<"x/y="<<x/y<<endl;
  12.     cout<<"x%y="<<x%y<<endl;  
  13.     system("pause");
  14.     return 0;      
  15. }
複製代碼

TOP

  1. #include<iostream>
  2. #include<cstdlib>
  3. using namespace std;
  4. int main()
  5. {
  6.      int x=11,y=3;
  7.      cout<<"當x等於"<<x<<",y等於"<<y<<"時..."<<endl;
  8.      cout<<"x+y="<<x+y<<endl;
  9.      cout<<"x-y="<<x-y<<endl;
  10.          cout<<"x*y="<<x*y<<endl;
  11.          cout<<"x/y="<<x/y<<endl;
  12.          cout<<"x%y="<<x%y<<endl;
  13.          
  14.      system("pause");
  15.      return 0;   
  16. }
複製代碼

TOP

  1. #include<iostream>
  2. #include<cstdlib>
  3. using namespace std;
  4. int main()
  5. {
  6.    
  7.     int x=10,y =3;
  8.      
  9.      cout<<"當x的質為"<<x<< ",y的質為"<<y<<"時..."<<endl;
  10.      cout<<"x+y="<<x+y<<endl;
  11.      cout<<"x-y="<<x+y<<endl;
  12.      cout<<"x*y="<<x+y<<endl;
  13.      cout<<"x/y="<<x+y<<endl;
  14.      cout<<"x%y="<<x+y<<endl;
  15.      
  16.      system("pause");
  17.      return 0;
  18. }
複製代碼

TOP

返回列表