zoukankan      html  css  js  c++  java
  • C Primer 编程练习

    2.1

    #include<stdio.h>
    int main(void)
    {
        printf("Co Khime ");
        printf("Co Khime ");
        printf("Co ");
        printf("Khime");
        return 0;
    }

    2.2

    #include<stdio.h>
    int main(void)
    {
        printf("Co Khime ");
        printf("YiLaiAn");
        return 0;
    }

    2.3

    #include<stdio.h>
    int main(void)
    {
        int y;
        y = 25;
        printf("Khiem is %d year old and she has live %d days", y, 365 * y);
    }

    2.4

    #include<stdio.h>
    void jolly(void);
    void deny(void);
    int main(void)
    {
        jolly();
        jolly();
        jolly();
        deny();
    }
    void jolly(void)
    {
        printf("For he's a jolly good fellow! ");
    }
    void deny(void)
    {
        printf("Which nobody can deny!");
    }

    2.5

    #include<stdio.h>
    void br(void);
    void ic(void);
    int main(void)
    {
        br();
        printf(",");
        ic();
        printf(" ");
        ic();
        printf(", ");
        br();
        
    }
    void br(void)
    {
        printf("Brazil, Russia");
    }
    void ic(void)
    {
        printf("India China");
    }

    2.6

    #include<stdio.h>
    int main(void)
    {
        int toes;
        toes = 10;
        printf("toes is %d , Double toes is %d and Quare toes is %d", toes, 2 * toes, toes * toes);
        return 0;
    }

    2.7

     #include<stdio.h>
    void sme(void);

    int main(void)
    {
        sme();
        sme();
        sme();
        printf(" ");
        sme();
        sme();
        printf(" ");
        sme();
    }
    void sme(void)
    {
        printf("Smile!");
    }

    -------------------------------------------------------------------------------------------------------------------------------------------------

    3.1

     3.2

    #include<stdio.h>

    int main(void)
    {
        int number;
        printf("plaease enter the number of char ");
        scanf("%d",&number);
        printf("the char of the number is %c",number);
        return 0;
    }

  • 相关阅读:
    华东交通大学2017年ACM双基程序设计大赛题解
    hdu2010(dfs+剪枝)
    欧拉函数phic以及超大数的快速幂
    想了一天的题目QAQ 毛线数列的最值
    记一下STL的一个题
    hdu1877进制转换
    hdu1002大数相加
    hdu1576逆元的一道水题
    Courses
    CodeForce-813B The Golden Age(数学+枚举)
  • 原文地址:https://www.cnblogs.com/Khime/p/11622560.html
Copyright © 2011-2022 走看看