Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <vector>
- #include <math.h>
- #include <map>
- #include <set>
- #include <string>
- using namespace std;
- long double fact(int N)
- {
- if(N < 0) {
- return 0;}
- if (N == 0){
- return 1;
- }else {
- return N * fact(N - 1);
- }
- }
- long long unsigned int my_pow(int a,int n,int m){
- if(n==0){
- return 1;
- } else{
- if(n%2 == 0){
- return (int(pow((my_pow(a,n/2,m)),2))) % m;
- } else{
- return (a*my_pow(a,n-1,m))%m;
- }
- }
- }
- bool is_constant(char ch){
- if (ch == 'a' || ch == 'e' || ch == 'o' || ch == 'y'||ch == 'i' || ch == 'u'){
- return false;
- }
- return true;
- }
- int is_equal(string s11,string s22, int k){
- for(int ii = (s11.length()-k), jj = 0; ii < s11.length(), jj < k; ii++, jj++){
- if(s11[ii] != s22[jj]){
- return 0;
- }
- }
- return 1;
- }
- int main() {
- //========== 2 ===========
- int vowels=0, consonsnts=0;
- char current;
- current = getchar();
- while (current != '\n' ){
- switch (current){
- case 'a':
- case 'e':
- case 'o':
- case 'u':
- case 'i':
- case 'y':
- vowels++;
- break;
- default:
- consonsnts++;
- break;
- }
- current = getchar();
- // putchar(current);
- }
- cout<< "vowels "<<vowels<<" "<<endl;
- cout<< "consonants "<<consonsnts<<" "<<endl;
- if(consonsnts>vowels){
- cout << "obviously more consonats";
- } else if(consonsnts == vowels){
- cout << "the same number ";
- } else{
- cout << "obviously more vowels";
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement