第一次作业

1编写程序,"我爱学习c语言"

#include<stdio.h>
main()
{
	printf("我爱学习c语言"); 
}

  

 

 2,分行输出自己的专业和姓名.

#include<stdio.h>
main()
{
	printf("专业:计算机科学与技术 姓名:翁传宝"); 
}

  

 

 3.用*号输出c的图案

#include<stdio.h>
main()
{
	printf("       *\n     *\n   *\n     *\n       *\n   "); 
}

  

 

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

#include<stdio.h>
main()
{
	int a=4;
	int b=6;
	printf("%d%d\n ",a,b); 
}

  

 

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

#include<stdio.h>
main()
{
    float m=1.23;
    double n=4.56;
	printf("%f%f\n",m,n); 
}

  

 

posted @ 2021-10-06 13:27  最完美的火锅  阅读(8)  评论(0编辑  收藏  举报