C++语言基础

C++ Note

参考文档:
http://see.xidian.edu.cn/cpp/biancheng/cpp/jichu/

1
2
3
4
5
6
7
8
#include<stdio.h>
int main(void)
{
/* code */
printf("Hello World!\n");
return 0;
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#include "stdio.h"
void main()
{
int x,y;
for(x=1,y=1;y<50;y++)
{
if(x>=10)
break;
if(x%3==1)
{
x+=5;
continue;
}
x+=3;
}
printf("x=%d,y=%d\n",x,y);
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#include "stdio.h"
void main()
{
int x,y;
for(x=1,y=1;y<50;y++)
{
if(x>=10)
break;
if(x%3==1)
{
x+=5;
continue;
}
x+=3;
}
printf("x=%d,y=%d\n",x,y);
return x,y;
}