Board logo

標題: 五則運算(一) [打印本頁]

作者: 陳品肇    時間: 2018-10-3 18:14     標題: 五則運算(一)

  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. }
複製代碼

作者: 曲書辰    時間: 2018-10-6 14:28

  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. }
複製代碼

作者: 吳孟修    時間: 2018-10-6 14:31

  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. }
複製代碼

作者: 章幼莛    時間: 2018-10-6 14:32

  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# 陳品肇
作者: 趙一鳴    時間: 2018-10-6 14:33

  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. }
複製代碼

作者: 王瑞喻    時間: 2018-10-6 14:36

  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.     }
複製代碼

作者: 周孫印    時間: 2018-10-6 14:37

  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. }
複製代碼

作者: 葉映琁    時間: 2018-10-6 14:38

  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. }
複製代碼

作者: 吳孟書    時間: 2018-10-6 14:39

  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. }
複製代碼

作者: 葉千郁    時間: 2018-10-6 14:43

  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. }
複製代碼

作者: 洪寬瀧    時間: 2018-10-13 13:11

  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. }
複製代碼





歡迎光臨 種子論壇 | 高雄市資訊培育協會學員討論區 (http://seed.istak.org.tw/) Powered by Discuz! 7.2