Codeforces --- string task
- #include <iostream>
- #include <cstring>
- using namespace std;
- int main()
- {
- int i,j,k,iLength,l;
- string sIn;
- char cOut[301] = {'0'};
- bool bCheck;
- char cList[6] = {'a','e','i','o','u','y'};
- cin >> sIn;
- iLength = sIn.length();
- i = 0;
- cOut[0] = '.';
- j = 1;
- while ( i<iLength )
- {
- bCheck = 0;
- if ( sIn[i] > 64 && sIn[i] < 91 )
- sIn[i] = sIn[i] + 32;
- for ( k=0 ; k<6 ; k++ )
- {
- if ( sIn[i] == cList[k] )
- bCheck = 1;
- }
- if ( bCheck == 0 )
- {
- cOut[j] = sIn[i];
- cOut[j+1] = '.';
- j=j+2;
- }
- i++;
- }
- //cOut[j-1] ='P';
- // cout << i<<" " <<j <<endl;
- for (l=0 ;l<j-1 ;l++)
- cout << cOut[l] ;
- if ( j>1)
- cout << endl;
- }
留言
張貼留言