最新回答 / 慕函數(shù)7131464
int main(){? ?struct Student stu[50];? ?stu[20].math=50;? ?stu[20].english=50;? ?return 0;}里的?struct Student stu[50];是重新命名為stu了嗎
2022-11-13
最贊回答 / qq_幕布斯0176761
用int main時(shí)需要返回一個(gè)值,return 0;表示返回的值是0,在函數(shù)調(diào)用的時(shí)候會(huì)用到返回的值,就好比在一個(gè)函數(shù)調(diào)用的時(shí)候,return 1;則函數(shù)返回后會(huì)給主函數(shù)返回1這個(gè)值;
2022-11-10
#include <stdio.h>
#include <iostream>
using namespace std;
int main()
{
printf("Hello World! This is C Style\n");
cout<<"Hello World! This is C++ Style"<<endl;
return 0;
}
#include <iostream>
using namespace std;
int main()
{
printf("Hello World! This is C Style\n");
cout<<"Hello World! This is C++ Style"<<endl;
return 0;
}
2022-11-03
最新回答 / qq_慕慕6286932
std::endl;是因?yàn)闆](méi)有聲明#include<iostream>,所以帶了一個(gè)std::,endl是表示該換行了.以上為個(gè)人理解
2022-11-01
最新回答 / qq_幕布斯0176761
#include<stdio.h>int main(int argc,char **argv){? ? int a=1;? ? int b=2;? ? int c=a+b;? ? int d=a-b;? ? int e=a*b;? ? int f=a/b;? ? int g=a%b;? ??? ? printf("%d %d %d %d %d",c,d,e,f,g);? ? return 0;}
2022-11-01
最新回答 / 慕仙4298044
共用體使用union關(guān)鍵字聲明,內(nèi)部聲明的多個(gè)字段共享內(nèi)存空間,共用體的占用空間與共用體內(nèi)聲明的空間占用最大的類型占用空間一致,并且對(duì)齊,只能使用共用體中的一個(gè)字段(根據(jù)不同的場(chǎng)景使用不同類型的字段),不能同時(shí)使用共用體中多個(gè)字段。
2022-10-24
#include <stdio.h>
#include <iostream>
enum Week
{
Mon, // 星期一
Tue, // 星期二
Wed, // 星期三
Thu, // 星期四
Fri, // 星期五
Sat, // 星期六
Sun, // 星期日
};
int main(int argc,char **argv){
Week today = Week::Wed;
printf("星期 %d\n", today + 1);
return 0;
}
#include <iostream>
enum Week
{
Mon, // 星期一
Tue, // 星期二
Wed, // 星期三
Thu, // 星期四
Fri, // 星期五
Sat, // 星期六
Sun, // 星期日
};
int main(int argc,char **argv){
Week today = Week::Wed;
printf("星期 %d\n", today + 1);
return 0;
}
2022-10-19
#include <stdio.h>
#include <iostream>
int main(int argc,char **argv)
{
int a = 0;
float b = 9.5;
std::cout << a << ", " << b;
printf("a: %d, b: %f", a, b);
return 0;
}
#include <iostream>
int main(int argc,char **argv)
{
int a = 0;
float b = 9.5;
std::cout << a << ", " << b;
printf("a: %d, b: %f", a, b);
return 0;
}
2022-10-19
#include <stdio.h>
int main(int argc,char **argv)
{
int a = 1;
int b = 2;
int tmp = a;
a = b;
b = tmp;
printf("a = %d, b = %d", a , b);
return 0;
}
int main(int argc,char **argv)
{
int a = 1;
int b = 2;
int tmp = a;
a = b;
b = tmp;
printf("a = %d, b = %d", a , b);
return 0;
}
2022-10-14
最新回答 / weixin_慕姐5123743
你可以在瀏覽器中搜索并進(jìn)入它的官網(wǎng),選擇社區(qū)下載就行了,之后在桌面雙擊它選擇c++那個(gè),就會(huì)運(yùn)行安裝
2022-10-05
#include<stdio.h>
#include <iostream>
using namespace std;
int main()
{
cout <<"char "<< sizeof(char)<<endl;
cout <<"short "<< sizeof(short)<<endl;
cout <<"int "<< sizeof(int)<<endl;
cout <<"long "<< sizeof(long)<<endl;
cout <<"long long "<< sizeof(long long);
return 0;
}
#include <iostream>
using namespace std;
int main()
{
cout <<"char "<< sizeof(char)<<endl;
cout <<"short "<< sizeof(short)<<endl;
cout <<"int "<< sizeof(int)<<endl;
cout <<"long "<< sizeof(long)<<endl;
cout <<"long long "<< sizeof(long long);
return 0;
}
2022-10-04
#include<iostream>
using namespace std;
int main()
{
cout<<"Hello World!This is C++style"<<endl;
printf("Hello World!This is C Style");
}
using namespace std;
int main()
{
cout<<"Hello World!This is C++style"<<endl;
printf("Hello World!This is C Style");
}
2022-09-29