虔南吧 关注:6贴子:575
  • 21回复贴,共1


IP属地:江西来自Android客户端1楼2016-12-21 17:25回复
    #include<stdio.h>
    int main(void)
    {
    int num;
    num=1;
    printf("i am a simple");
    printf(" computer.\n");
    printf("my favorite number is %dbecause it is the first.\n",num);
    return 0;
    }


    IP属地:江西来自Android客户端2楼2016-12-21 17:26
    收起回复
      #include<stdio.h>
      int main (void)
      {
      char name[40];
      scanf("%s",&name);
      printf("我打的字是%s",name);
      return 0;
      }


      IP属地:江西来自Android客户端3楼2016-12-21 17:27
      收起回复
        #include<stdio.h>
        int main (void)
        {
        float weight;
        float value;
        printf("are you worth your weight in platinum?\n");
        printf("let's check it out.\n");
        printf("please enter your weight in pounds:");
        scanf("%f",&weight);
        value=1700.0*weight*14.5833;
        printf("your weight in platinum is worth $%.2f.\n",value);
        printf("you are easily worth that!if platinum prices drop,\n");
        printf("eat more to maintain your value.\n");
        return 0;
        }


        IP属地:江西来自Android客户端4楼2016-12-21 17:28
        收起回复
          #include <stdio.h>
          int main (void)
          {
          int ten;
          printf("请你输入将要转换为八进制,十六进制的十进制数:");
          scanf("%d",&ten);
          printf("%#o是你要的八进制表示,%#X是你要的十六进制表示",ten,ten);
          return 0;
          }


          IP属地:江西来自Android客户端5楼2016-12-21 17:31
          收起回复
            #include <stdio.h>
            int main (void)
            {
            float a=24.0000;
            printf("%f的\nfloat值是%f\nlongfloat值是%lf\n指数式值是%e\n",a,a,a,a);
            return 0;
            }


            IP属地:江西来自Android客户端6楼2016-12-21 17:33
            收起回复
              #include<stdio.h>
              int main(void)
              {
              char name[40];
              printf("你的名字?\n");
              scanf("%s", name);
              printf("你好%s,我是一个机器人\n",name);
              getchar();
              printf("很高兴认识你。\n");
              getchar();
              printf("我们可以做朋友吗?%s\n",name);
              getchar();printf("不论如何很高兴你能打开这个程序\n");
              getchar();
              printf("再见");
              return 0;
              }


              IP属地:江西来自Android客户端7楼2016-12-21 17:35
              收起回复
                #include<stdio.h>
                int main (void)
                {
                char grade='A';
                printf("这个A的ASCII代码是%d",grade);
                return 0;
                }


                IP属地:江西来自Android客户端8楼2016-12-21 17:36
                收起回复
                  #include<stdio.h>
                  int main(void)
                  {
                  char name[40];
                  int a;
                  printf("欢迎使用本程序。\n");
                  printf("我是(●—●),你叫什么名字?\n");
                  scanf("%s",&name);
                  printf("\n你好%s,见到你很高兴。\n",name);
                  getchar();
                  printf("\n你知道吗?\n\n当你告诉我一个十进制的数时,我可以告诉你它的十六进制表达\n");
                  getchar();
                  printf("让我们试试吧,请告诉我这个数字是:______\b\b\b\b\b\b");
                  scanf("%d",&a);
                  printf("\n%d的十六进制数是%#X\n",a,a);
                  getchar();
                  printf("\n和你聊天真的很愉快\n");
                  getchar();
                  printf("但是我要走了。\n");
                  getchar();
                  printf("期待下次和你见面\n");
                  printf("\n
                  再 见\n");
                  return 0;
                  }


                  IP属地:江西来自Android客户端9楼2016-12-21 17:40
                  回复
                    #include<stdio.h>
                    #include<math.h>
                    int main()
                    {
                    double a,b,c,disc,x1,x2,p,q;
                    printf("若有一元二次方程一般形式形如:\n a*x^2+b*x+c=0\n且分别输入a,b,c\n");
                    printf("a=");
                    scanf("%lf",&a);
                    printf("\nb=");
                    scanf("%lf",&b);
                    printf("\nc=");
                    scanf("%lf",&c);//6到12条是我加的
                    disc=b*b-4*a*c;
                    p=-b/(2.0*a);
                    q=sqrt(disc)/(2.0*a);
                    x1=p+q;x2=p-q;
                    printf("有解得:\nx1=%7.2f\nx2=%7.2f\n",x1,x2);
                    return 0;
                    }


                    IP属地:江西来自Android客户端10楼2016-12-21 17:40
                    回复