最新回答 / AndroidRA9
如果你的if 語句是在for 循環(huán)里的話,執(zhí)行了continue語句后這次的printf語句不會執(zhí)行,但是下一個循環(huán)的printf語句有可能會被執(zhí)行。
2023-05-01
最贊回答 / 輝同
int argc, char **argv 這兩個參數(shù)用在下面這個場景比如編譯完的程序名為pro.exe,在命令行里面如下運(yùn)行:pro.exe "aaa" "bbb" "ccc"argc 獲取到的是pro.exe后的帶的參數(shù)個數(shù),這里為3**argv 獲取到是數(shù)組:{"aaa", "bbb", "ccc"}這樣就可以在程序中展開這兩個參數(shù),做你程序具體要做的事件。如果是int main()這種寫法,則pro.exe沒辦法獲取后面的參數(shù), 當(dāng)然程序如果不需要帶參數(shù),則可以這樣寫。
2023-04-19
最新回答 / 慕沐8157732
enum Week{? ? Mon,//星期一//第一個默認(rèn)為0? ? Tue,//星期二 1? ? Wed,//星期三 2? ? Thu,//星期四 3? ? Fri=0,//星期五 你賦值為0? ? Sat,//星期六 1? ? Sun,//星期日 2};
2023-03-26
最新回答 / 慕沐8157732
#include?<stdio.h>?這是C語言的頭文件 #include?<iostream>?這是C++語言的頭文件兩者可以理解作用相同
std::cin?>>?a?>>?b;這里是屬于#include?<iostream>因此,
必須要包含#include?<iostream>
2023-03-23
#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;
}
2023-03-21
這里是不是講的不對,a=100 轉(zhuǎn)short b 是因?yàn)?00在short的可轉(zhuǎn)換范圍內(nèi),如果你換成1000000試試,不管你是 short b = a,還是short b = (short)a; 都沒用,都會丟失
2023-03-19
#include<iostream>
#include<stdio.h>
using namespace std;
int main ()
{
char a;int b;
for(b=0;b<5;b++)
{
cout << "* * * * * * * *" << endl;
}
}
#include<stdio.h>
using namespace std;
int main ()
{
char a;int b;
for(b=0;b<5;b++)
{
cout << "* * * * * * * *" << endl;
}
}
2023-03-17
#include<iostream>
#include<stdio.h>
using namespace std;
int main ()
{
char a;int b,c;
for(c=0;c<5;c++)
{
for(b=0;b<8;b++)
{
cout << "* " ;
}
cout << " " << endl;
}
}
#include<stdio.h>
using namespace std;
int main ()
{
char a;int b,c;
for(c=0;c<5;c++)
{
for(b=0;b<8;b++)
{
cout << "* " ;
}
cout << " " << endl;
}
}
2023-03-17
int main()
{float a;int b;cin >> a ;
if(a>=90){b=1;}
else if(90>a&a>=75)
{b=2;}
else if(75>a&a>=60){b=3;}
else {b=4;}
switch(b)
{case 1:cout << "優(yōu)" << endl;break;case 2:cout << "良" << endl;break;case 3:cout << "中" << endl;break;case 4:cout << "差" << endl;break; }return 0;}
{float a;int b;cin >> a ;
if(a>=90){b=1;}
else if(90>a&a>=75)
{b=2;}
else if(75>a&a>=60){b=3;}
else {b=4;}
switch(b)
{case 1:cout << "優(yōu)" << endl;break;case 2:cout << "良" << endl;break;case 3:cout << "中" << endl;break;case 4:cout << "差" << endl;break; }return 0;}
2023-03-17