First Part
尝试第一个程序:
#include <iostream>
using namespace std;
int main()
{
cout << "Hello world!" << endl;
return 0;
}
Second Part
T
Third Part
7.位运算(看书)
cout<<"hello world\n" ;
例子:判断年份是否为闰年:
int main(){
cout<<"\n\n\+++判断一个年份是否是闰年+++\n";
int year;
int flag=0;//作为判断标识符
cout<<"Please input the year number:"<<endl;
cin>>year;
if((year%4==0&&year%100!=0)||(year%400==0))
flag=1;//是闰年flag=1
if(flag)
cout<<year<<"是闰年";
else
cout<<year<<"不是闰年";
return 0;
}