返回列表 發帖
  1. #include<iostream>
  2. #include<cstdlib>
  3. using namespace std;
  4. int main()
  5. {
  6.     string name="尤爾呈",school="瑞興國小";
  7.     int age=10;
  8.     float x=145,y=40;
  9.    
  10.     cout<<"我的大名:"<<name<<endl;
  11.     cout<<"就讀:"<<school<<endl;
  12.     cout<<"今年:"<<age<<"歲"<<endl;
  13.     cout<<"身高:"<<x<<"公分"<<endl;
  14.     cout<<"體重:"<<y<<"公斤"<<endl;                        

  15.     system("pause");
  16.     return 0;
  17. }   
  18.             
  19.    
  20.                         
複製代碼

TOP

  1. #include<iostream>
  2. #include<cstdlib>
  3. using namespace std;

  4. int main()
  5. {   
  6.     int x=9999,y=9858;
  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.     int x,y;
  7.     cout<<"請輸入x;"<<endl;
  8.     cin>>x;
  9.     cout<<"請輸入y;"<<endl;
  10.     cin>>y;   
  11.    
  12.    
  13.     cout<<"當x等於"<<x<<"y等於"<<y<<"時"<<endl;
  14.     cout<<"x+y="<<x+y<<endl;
  15.     cout<<"x-y="<<x-y<<endl;
  16.     cout<<"x*y="<<x*y<<endl;
  17.     cout<<"x/y="<<x/y<<endl;
  18.     cout<<"x%y="<<x%y<<endl;
  19.    
  20.     system("pause");
  21.     return 0;
  22. }
複製代碼

TOP

返回列表