首页 > 其他分享 >第一天代码

第一天代码

时间:2023-02-07 16:06:58浏览次数:52  
标签:main return 第一天 int max 代码 printf include

#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;
}


标签:main,return,第一天,int,max,代码,printf,include
From: https://blog.51cto.com/u_15957017/6042199

相关文章