返回列表 發帖
回復 1# may


    #include<iostream>
using namespace std;
int main()
{
int x=100,y=15;
cout<<"x的值為"<<x<<endl;
cout<<"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;
   
}

TOP

回復 1# may


#include<iostream>
using namespace std;
int main()
{
int x=100,y=15;
cout<<"x的值為"<<x<<endl;
cout<<"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;

TOP

回復 1# may


#include<iostream>
using namespace std;
int main()
{
int x=100,y=15;
cout<<"x的值為"<<x<<endl;
cout<<"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;

TOP

回復 5# 林宥辰


#include<iostream>
using namespace std;
int main()
{
int x,y;
cout<<"請輸入x的值:";
cin>>x;
cout<<endl;
cout<<"請輸入y的值:";
cin>>y;
cout<<endl;
cout<<"x的值為"<<x<<endl;
cout<<"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;
   
}

TOP

返回列表