第一次作业

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

1
2
3
4
5
#include <stdio.h>
main()
{
    printf("我爱学习学习C语言!");
}

  

 

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

1
2
3
4
5
#include <stdio.h>
main()
{
    printf("计算机科学与技术\n赵坤龙");
}

  

 

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

1
2
3
4
5
6
#include <stdio.h>
 
int main()
{
   printf("    **\n   *\n  *\n *\n*\n *\n  *\n   *\n    **\n");
}

  

 

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

1
2
3
4
5
6
7
8
9
#include <stdio.h>
main()
{
    int a=6;
    int b=9;
    printf("%d\n %d ",a,b);
     
 
}

  

 

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

1
2
3
4
5
6
7
#include <stdio.h>
main()
{
    float a=6.45;
    double b=9.12;
    printf("%f\n %lf ",a,b);
}

 

 

 

posted @ 2021-11-25 16:49  zx。  阅读(24)  评论(0)    收藏  举报