第一次作业

1.编写程序,输出“我爱学习c语言”

#include<stdio.h>

main()

{

printf("我爱学习c语言!");

}

 

2.分行输出自己的专业和名字。

#include<stdio.h>
main()
{
printf("计算机科学与技术\n");
printf("张继炫");
}

 

 

3.用*号输出字母c的图案

#include<stdio.h>

main()

{

printf("   ****\n");

printf(" ***\n");

printf("**\n");

printf(" ***\n");

printf("   ****\n");

}

 

 

4.编写程序,定义两个整型变量,赋值并输出

#include<stdio.h>

main()

{

         int a = 2;

         int b = 3;

printf("%d\n",a);

printf("%d",b);

}

 

 

5.编写程序,定义一个单精度和一个双精度的变量,赋值并输出

#include<stdio.h>
main()
{
float a = 2;
double b = 3;
printf("%f\n",a);
printf("%f",b);
}

 

posted @ 2021-10-07 11:48  张继炫  阅读(21)  评论(0)    收藏  举报