int testPoint = 85;
if (testPoint>=90) { std::cout<<"成績:優秀"<<std::endl;
}else if( 90 >testPoint >= 75){std::cout<<"成績:良"<<std::endl;
}else if (75 > testPoint >= 60) {
std::cout<<"成績:及格"<<std::endl;
}else if ( testPoint<60 ){
std::cout<<"成績:不及格"<<std::endl;
}
if (testPoint>=90) { std::cout<<"成績:優秀"<<std::endl;
}else if( 90 >testPoint >= 75){std::cout<<"成績:良"<<std::endl;
}else if (75 > testPoint >= 60) {
std::cout<<"成績:及格"<<std::endl;
}else if ( testPoint<60 ){
std::cout<<"成績:不及格"<<std::endl;
}
#include <stdio.h>
int main(int argc,char **argv)
{
printf("Hello World!\n");
return 0;
} #include <stdio.h>
int main(int argc,char **argv)
{
printf("Hello World!\n");
return
int main(int argc,char **argv)
{
printf("Hello World!\n");
return 0;
} #include <stdio.h>
int main(int argc,char **argv)
{
printf("Hello World!\n");
return
2023-04-22
#include #include <stdio.h>
int main(int argc,char **argv)
{
printf("Hello World!\n");
return 0;
}
int main(int argc,char **argv)
{
printf("Hello World!\n");
return 0;
}
2023-03-27
#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