cout<<"this program cauculates many weird stuff.\npls input the value of a:";
cin>>a;
cout<<"pls input the value of b:";
cin>>b;
cout<<"\nthe value of a+b is:\t"<<a+b<<"\nthe value of a-b is :\t"<<a-b<<"\nthe value of a*b is:\t"<<a*b<<"\nthe value of a/b is :\t"<<a/b<<"\nthe value of a%b is :\t"<<a%b<<"\n";
system("pause");
return 0;
}
複製代碼
作者: 蕭宏宇 時間: 2023-6-3 10:47
#include<iostream> //input&output stream
#include<cstdlib>//c standard library
using namespace std ;//使用命名空間 std
int main()
{
int x=10,y=3;
cout<<"當x等於"<<x<<",y等於"<<y<<"時..."<<endl;
cout<<"x+y="<<x+y<<endl;
cout<<"x-y="<<x-y<<endl;
cout<<"x*y="<<x*y<<endl;
cout<<"x/y="<<x/y<<endl;
cout<<"x%y="<<x%y<<endl;
system("pause");
return 0;
}
複製代碼
作者: 陳品諺 時間: 2023-6-5 20:02
#include<iostream>
#include<cstdlib>
using namespace std;
int main()
{
int x = 10, y = 3;
cout << "當x等於" << x << ", y等於" << y << "時..." << endl;