zzyaizj
宁忽~
2020-11-24 23:09
采纳率: 100%
浏览 3

求大佬教,为什么xy的值输出不了------新手菜鸟

#include<stdio.h>
int main()
{
 long a,b;
 float x,y;
 printf("输入a,b:\n");
 scanf("%ld,%ld",&a,&b);
 printf("输入x,y:\n");
 scanf("%5.2f,%5.2f",&x,&y);
 printf("a=%ld\n b=%ld\n x=%5.2f\n y=%5.2f\n",a,b,x,y); 
}
  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 邀请回答

2条回答 默认 最新

  • qq_25376897
    qq_25376897 2020-11-25 09:16
    已采纳
    #include<stdio.h>
    int main()
    {
     long a,b;
     float x,y;
     printf("输入a,b:\n");
     scanf("%ld,%ld",&a,&b);
     printf("输入x,y:\n");
     scanf("%f,%f",&x,&y);
     printf("a=%ld\n b=%ld\n x=%5.2f\n y=%5.2f\n",a,b,x,y); 
    }

    输入数据时不能规定数据的精度

    点赞 评论
  • weixin_45317919
    Zhi Zhao 2020-11-25 09:15
    #include<stdio.h>
    int main()
    {
     long a,b;
     float x,y;
     printf("输入a,b:\n");
     scanf("%ld,%ld",&a,&b);
     printf("输入x,y:\n");
     scanf("%f,%f",&x,&y);
     printf("a=%ld,b=%ld\nx=%5.2f,y=%5.2f\n",a,b,x,y); 
    }
    点赞 评论

相关推荐