返回列表 發帖
#include<iostream>
#include<cstdlib>
using namespace std;
int main ()
{
    int x=20`y=1
    x+y=21
    x-y=19
    x*y=20
    x/y=20
    x%y=0
    system("pause");   
    return 0;
         }

TOP

#include<iostream>
#include<cstdlib>
using namespace std;
int main ()
{
    int x=20,y=1;
    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;
         }

TOP

返回列表