#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>
#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;
}
#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");
}