dotcpp小熊


私信TA

用户名:1014231364

访问量:2723

签 名:

等  级
排  名 1311
经  验 2884
参赛次数 2
文章发表 3
年  龄 11
在职情况 学生
学  校
专  业

  自我简介:

http://www.dotcpp.com/oj/problem1415.html关于这道题我做了许多遍,但都是错的。请问怎么做?(附上我的代码)

#include<stdio.h>
int main()
{
    int a,a1,i=1;
 while(scanf("%d",&a)!=2)
 {
  if(a>2)
  {}
  else
  {return 1;}
  a1=0;
        a1=a;
        while(a>0)
        {
            printf("c");
            a--;
        }
        a=a1;
        a-=2;
  printf("\n");
        while(a>0)
        {
            printf("c \n");
   a--;
        }
        a=a1;
        while(a>0)
        {
            printf("c");
            a--;
        }
  i++;
 }
    return 0;
}

 

0.0分

0 人评分

看不懂代码?想转换其他语言的代码? 或者想问其他问题? 试试问问AI编程助手,随时响应你的问题:

编程语言转换万能编程问答  

代码解释器

代码纠错

SQL生成与解释

  评论区

我也是刚学c语言,你的程序在电脑上也可以运行,但不了解你的代码中的i有什么作用,感觉把它去掉也可以。
2018-02-18 20:44:06
做这种题有意思么?
2018-02-18 20:38:49
  • «
  • 1
  • »