求知講堂C語言/C++視頻104天完整版 學(xué)完可就業(yè)

p25:預(yù)處理器命令
#include <stdio.h>
#define MAX(a,b) (a>b)? a:b //在帶參宏定義中,形式參數(shù)不分配內(nèi)存單元,因此不必做類型定義
#define PI 3.14159265
#define ARRAY_SIZE 1000
#define G 9.8
#define S(a,b) a * b
#define S(r) PI * r * r
#define CIRCLE(r,L,S,V) L = 2 * PI * r; S = PI * r * r; V = 4.0 / 3 * PI * r * r * r
#define LETTER
int main(void)
{
//int myArray[ARRAY_SIZE];
char str[20] = "C Language";
char c;
int i = 0;
while ((c = str[i]) != '\0')
{
i++;
#ifdef LETTER
if (c >= 'a' && c <= 'z')
{
c = c - 32;
}
#else
if (c >= 'A' && c <= 'Z')
{
c = c + 32;
}
#endif//
????
printf("%c",c);
}
printf("\n");
return 0;
//int x,y,max;
//
//printf("input two numbers:");
//scanf_s(" % d % d",&x ,&y);
//max = MAX(x,y);
//printf("max = %d\n",max);
}
標簽: