Дали е буква

Да се въведе символ и да се провери дали е: буква, главна буква, гласна буква.

Публикувано в 11а, 11в с етикети . Постоянна връзка.

3 Responses to Дали е буква

  1. dreanor каза:
    #include <cstdlib>
    #include <iostream>
    #include <cctype>
    
    
    using namespace std;
    
    int main(int argc, char *argv[])
    {
        char a;
        cout << "wuwedi simwol: ";
        cin >>a;
        if (isalpha(a))
           { 
             cout << "Simwola e angliiska ";
             if (isupper(a)) cout << "glawna ";
                else cout << "malka ";
             tolower(a);
             switch (a){
                    case 'a': cout << "glasna bukwa\n"; break;
                    case 'e': cout << "glasna bukwa\n"; break;
                    case 'i': cout << "glasna bukwa\n"; break;
                    case 'o': cout << "glasna bukwa\n"; break;
                    case 'u': cout << "glasna bukwa\n"; break;
                    case 'y': cout << "glasna bukwa\n"; break;
                    default: cout << "suglasna bukwa\n ";
                    }
           }
        else cout<< "Newaliden simwol (trqbwa da e bukwa)\n";
        system("PAUSE");
        return EXIT_SUCCESS;
    }
    
  2. Gadget каза:
     
    char b;
        cout<<"Vavedete proizvolen simvol: "<<endl;
        cin>>b;
        if(((b>='a')&&(b<='z'))||((b>='A')&&(b<='Z')))
        cout<<"Simvolut e bukva!"<<endl;
        else
        cout<<"Simvolut ne e bukva!"<<endl;
        if((b>='A')&&(b<='Z'))
        cout<<"Simvolut e glavna bukva!"<<endl;
        //I-vi nachin za proverka na glasnata bukva
        if((b=='a')||(b=='A')||(b=='e')||(b=='E')||(b=='i')||(b=='I')||(b=='o')||(b=='O')||((b=='y')||(b=='Y'))
        cout<<"Simvolut e glasna bukva!"<<endl;
        //II-ri nachin za proverka na glasnata bukva
        switch(b){
                  case 'a':
                  case 'A': 
                  case 'e':
                  case 'E':
                  case 'i':
                  case 'I':
                  case 'y':
                  case 'Y':
                  case 'o':
                  case 'O':cout<<"Simvolut e glasna bukva!"<<endl;
                  default:cout<<"\n";
                  }      
    
  3. Prizraka каза:

    int main(int argc, char *argv[])
    {
    char x;
    cin>>x;
    cout<=’a’)&&(x=’A’)&&(x<='Z')))<<endl;
    system("PAUSE");
    return EXIT_SUCCESS;
    }

Вашият коментар