王雪奇

博客园 首页 新随笔 联系 订阅 管理
  1. 编写程序,输出"我爱学习C语言"

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

     

    1. 分行输出自己的专业与姓名

     

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

     

    1. 用*号输出C的图案

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

       

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

      2. #include<stdio.h>
        main() {
            int x = 2;
            int y = 1;
            printf("%d %d\n", x, y);
        ;
        }

         

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

          #include<stdio.h>
          main() {
              float x = 2;
              double y = 1;
              printf("%f %lf\n", x, y);
              ;
          }

           

posted on 2021-10-06 19:16  雪.?!  阅读(21)  评论(0)    收藏  举报