竞赛讨论区 > 我真的会谢,求大佬帮帮我(bushi)
头像
取个名字特难
编辑于 2022-11-06 10:28 河北
+ 关注

我真的会谢,求大佬帮帮我(bushi)

#include<iostream>

#include<cstdio>

using namespace std;

int main()

{

char ch;

bool f=false;

int num=0;

while((ch=getchar())!='\n');

{

if(f)

if(ch>='0'&&ch<='9')

num++;

else break;

if(ch=='.')f=true;

}

if(num>0)

cout<<num<<endl;

else

cout<<"输入不正确!"<<endl;

return 0;

}

14 8 C:\Users\Administrator\Documents\下册10(第3题).cpp [Error] break statement not within loop or switch

他这么说的

全部评论

(3) 回帖
加载中...
话题 回帖

等你来战

查看全部

热门推荐