• 博客园logo
  • 会员
  • 众包
  • 新闻
  • 博问
  • 闪存
  • 赞助商
  • HarmonyOS
  • Chat2DB
    • 搜索
      所有博客
    • 搜索
      当前博客
  • 写随笔 我的博客 短消息 简洁模式
    用户头像
    我的博客 我的园子 账号设置 会员中心 简洁模式 ... 退出登录
    注册 登录
Khime
博客园    首页    新随笔    联系   管理    订阅  订阅
C Primer 编程练习

2.1

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

 

2.2

#include<stdio.h>
int main(void)
{
    printf("Co Khime\n");
    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!\n");
}
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("\n");
    ic();
    printf(",\n");
    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("\n");
    sme();
    sme();
    printf("\n");
    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\n");
    scanf("%d",&number);
    printf("the char of the number is %c",number);
    return 0;
}

posted on 2019-10-04 17:11  Khime  阅读(171)  评论(0)    收藏  举报
刷新页面返回顶部
博客园  ©  2004-2025
浙公网安备 33010602011771号 浙ICP备2021040463号-3