第一次作业

1.编写程序输出“我爱C语言!”

#include< stdio.h >

main()

{

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

}

 

 

 

 

 

 

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

#include< stdio.h >

main()

{

 

   printf("计算机科学与技术\n  王琪涵\n");

}

 

 

 

3.用*输出字母C的图案

 

#include< stdio.h >

main()

{

 printf("Hello C-world !\n");

 printf(" *** \n");

 printf(" *    \n ");

 printf("* \n" );

 printf("* \n" );

 printf("*\n ");

 printf( "***\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 %1f\n",m,n );

 

 diyici

 

posted @ 2021-10-03 18:54  露露0817  阅读(17)  评论(0)    收藏  举报