day03
誰Hengdaoすぐに、唯一の私のフライング牛グレート一般的な!
細部: [VSコンパイラでは、ある2書き込み入力機能:scanf_sと#pragma警告(無効:4996)}のscanf
:ここで学んだday02'veで
カバー知識ポイント:
エスケープ文字を調べる
(一部場合)select文を
ループ予備
機能予備
興味深い現象変数のアドレス
注:<1>は、このセクションの内容は暫定的なものでは、その後のアップデートでは詳細な知識を簡潔例。
<2>このセクションでは、過度の構文の定義、そう直接的例えば、単純、粗ありません。
1.
接触day02のエスケープ文字は、
例を示します:
2.
select文
(1)if(表达式){ 语句; }
(2 if(表达式){语句1;} else{语句2;}
(3)if(表达式1){语句1;} else if(表达式2){语句2;} else{语句3;}
//小技巧:这么写可以看起来更专业,也方便检查错
if(1 == select){
printf("OK!");
}
else if(2 == select){
printf("不OK!");
}
else{
printf("很OK!");
}
3.
ループ
(1)whileループ
文の(2)
(3)は声明ながら行う
4.機能
#include <stdio.h>
#include<windows.h>
#pragma warning(disable : 4996)
int MAX(int _x, int _y)
{
int c = 0;
if (_x> _y)
{
c = _x;
return c;
}
else if (_x <_y)
{
c = _y;
return c;
}
else{
c = _x;
return c;
}
}
int main()
{
int a = 0;
int b = 0;
int c = 0;
printf("请输入两个数字:");
scanf("%d%d", &a, &b);
c = MAX(a, b);
printf("%d\n", c);
system("pause");
return 0;
}
5.これは、共有へ出、非常に興味深いです