实验 1

C语言实验——图形输出(字符常量练习)

#include <stdio.h>
#include <stdlib.h>

int main()
{
    printf("#\n");
    printf("##\n");
    printf("###\n");
    printf("####\n");
    printf("#####\n");
    printf("######\n");
    return 0;
}

/***************************************************
User name: sm180216刘志鹏
Result: Accepted
Take time: 0ms
Take Memory: 140KB
Submit time: 2018-10-15 10:54:54
****************************************************/


A+B Problem

#include <stdio.h>
#include <stdlib.h>

int main()
{
     int a,b;
     scanf("%d %d",&a, &b);
     printf("%d\n",a+b);
    return 0;
}


/***************************************************
User name: sm180216刘志鹏
Result: Accepted
Take time: 0ms
Take Memory: 144KB
Submit time: 2018-10-15 11:08:39
****************************************************/

C语言实验——求两个整数之和

#include <stdio.h>
#include <stdlib.h>

int main()
{
     int a,b;
     a=123;
     b=456;
     printf("sum is %d\n",a+b);
    return 0;
}


/***************************************************
User name: sm180216刘志鹏
Result: Accepted
Take time: 0ms
Take Memory: 96KB
Submit time: 2018-10-15 11:10:03
****************************************************/

C语言实验——交换两个整数的值(顺序结构)

#include <stdio.h>
#include <stdlib.h>

int main()
{
    int x,y,t;
    scanf("%d%d",&x,&y);
    t=x;
    x=y;
    y=t;
    printf("%d %d",x,y);
    return 0;
}


/***************************************************
User name: sm180216刘志鹏
Result: Accepted
Take time: 0ms
Take Memory: 148KB
Submit time: 2018-10-15 11:15:30
****************************************************/

C语言实验——逆置正整数

#include <stdio.h>
#include <stdlib.h>

int main()
{
   int a,b,c,x,y;
   scanf("%d",&x);
   a=x%10;
   b=x/10%10;
   c=x/100%10;
   y=a*100+b*10+c;
   printf("%d\n",y);


    return 0;
}


/***************************************************
User name: sm180216刘志鹏
Result: Accepted
Take time: 0ms
Take Memory: 148KB
Submit time: 2018-10-15 11:51:21
****************************************************/

C语言实验——买糖果

#include <stdio.h>
#include <stdlib.h>

int main()
{
   int a,b,c,x,y;
   scanf("%d",&x);
   a=x%10;
   b=x/10%10;
   c=x/100%10;
   y=a*100+b*10+c;
   printf("%d\n",y);


    return 0;
}


/***************************************************
User name: sm180216刘志鹏
Result: Accepted
Take time: 0ms
Take Memory: 148KB
Submit time: 2018-10-15 11:51:21
****************************************************/

C语言实验——买糖果

#include <stdio.h>
#include <stdlib.h>

int main()
{
   int n,b,c;
   scanf("%d",&n);
   b=n*10/3;


   c=n*10%3;
   printf("%d %d",b,c);


    return 0;
}

/***************************************************
User name: sm180216刘志鹏
Result: Accepted
Take time: 0ms
Take Memory: 144KB
Submit time: 2018-10-15 11:53:21
****************************************************/
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值