#include <stdio.h>
int Max(int x, int y)
{
if (x > y)
return x;
else
return y;
}
int main()
{
int a = 10;
int b = 20;
int max = Max(a, b);
printf("max=%d\n", max);
return 0;
}
#include <stdio.h>
int Max(int x, int y)
{
if (x > y)
return x;
else
return y;
}
int main()
{
int a = 10;
int b = 20;
int max = Max(a, b);
printf("max = %d\n", max);
return 0;
}
#include <stdio.h>
#define MAX(X,Y)(X>Y?X:Y)
int main()
{
int a = 10;
int b = 20;
int max = 0;
max = MAX(a, b);
printf("max = %d\n", max);
return 0;
}
#include <stdio.h>
int main()
{
char ch = 'w';
char* pc = &ch;
printf("%d\n", sizeof(pc));
return 0;
}
#include<stdio.h>
int main()
{
int a = 10;
//printf("%p", a);
int* p = &a;
//printf("%p\n", p);
return 0;
}
#include<stdio.h>
struct book
{
char name[20];
short price;
};
int main()
{
struct book b1 = { "c语言程序设计",55 };
printf("书名:%s\n", b1.name);
printf("价格:%d\n", b1.price);
return 0;
}
#include<stdio.h>
struct book
{
char name[20];
short price;
};
int main()
{
struct book b1 = { "c语言程序设计",55 };
struct book* pb = &b1;
printf("%s\n", pb->name);
printf("%d\n", pb->price);
return 0;
}