第一次作业

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

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

 

 

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

 

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

 

 

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

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

 

 

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

#include<stdio.h>
main()
{
    int a = 2;
    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);
}

 

 

posted @ 2021-10-06 20:32  王欣彤  阅读(43)  评论(0)    收藏  举报