Advertisement
ioanaasdfgh

v54 siruri de caractere

Nov 15th, 2018
107
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.31 KB | None | 0 0
  1. #include<iostream>
  2. #include<string.h>
  3. using namespace std;
  4. int main ()
  5. {
  6.     char x[20];
  7.     int i,k1,k2;
  8.     cin.get(x,20);
  9.     cin.get();
  10.     strcpy(x,"bac2009");
  11.     k1=strlen(x);
  12.     k2=0;
  13.     for (i=0;i<strlen(x);i++)
  14.         if(x[i]>='0'&& x[i]<='9')
  15.         k2=k2+1;
  16.     cout << k1<<" "<<k2;
  17. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement