разработать программу поиска цифр в тексте и определить их количество С++
желательно полную со всеми библиотеками
Ответы
Ответ дал:
0
#include <iostream>
using namespace std;
int main(){
String str;
int count=0;
cin>>str;
for(int i=0;i<str.length();i++){
if(str.at(i)==0||str.at(i)==1||str.at(i)==2||str.at(i)==3||str.at(i)==4||str.at(i)==5||str.at(i)==6||str.at(i)==7||str.at(i)==8||str.at(i)==9){
count++;
}
}
cout<<count;
}
using namespace std;
int main(){
String str;
int count=0;
cin>>str;
for(int i=0;i<str.length();i++){
if(str.at(i)==0||str.at(i)==1||str.at(i)==2||str.at(i)==3||str.at(i)==4||str.at(i)==5||str.at(i)==6||str.at(i)==7||str.at(i)==8||str.at(i)==9){
count++;
}
}
cout<<count;
}
Вас заинтересует
2 года назад
2 года назад
7 лет назад
7 лет назад
9 лет назад
10 лет назад