#include <iostream>
using namespace std;
#include <string>
int main()
{
int a=1;
int b=2;
cout << "a+b=" << a+b<<endl;
cout << "a-b=" << a-b<<endl;
cout << "a*b=" << a*b<<endl;
cout << "a/b=" << a/b<<endl;
int c=5;
float d=3.25;
cout << "c+d=" << c+d<<endl;
}
using namespace std;
#include <string>
int main()
{
int a=1;
int b=2;
cout << "a+b=" << a+b<<endl;
cout << "a-b=" << a-b<<endl;
cout << "a*b=" << a*b<<endl;
cout << "a/b=" << a/b<<endl;
int c=5;
float d=3.25;
cout << "c+d=" << c+d<<endl;
}
這里是不是講的不對,a=100 轉short b 是因為100在short的可轉換范圍內,如果你換成1000000試試,不管你是 short b = a,還是short b = (short)a; 都沒用,都會丟失
2023-03-19
#include <stdio.h>
int main()
{
printf("Hello 你好! \n");
return 0;
}
這樣好像也可以
int main()
{
printf("Hello 你好! \n");
return 0;
}
這樣好像也可以
2023-03-13
#include<iostream> inr main(){ cout<<“hello world”<<endl; return 0; }
2023-02-23