7.3.. Napisati program koji za upisani samoglasnik (veliko slovo) ispisuje redni broj u samoglasnika u abecedi, prema slijedeæoj tabeli:
Listing programa:
//07311013
#include <iostream>
using namespace std;
int main()
{
char a;
cout<<"Veliko slovo"<<endl;
cout<<"Slovo (a)"<<endl;
cin>>a;
switch(a)
{
case 'A': cout<<"1"<<endl; cout<<endl; break;
case 'E': cout<<"5"<<endl; cout<<endl; break;
case 'I': cout<<"9"<<endl; cout<<endl; break;
case 'O': cout<<"15"<<endl; cout<<endl; break;
case 'U': cout<<"20"<<endl; cout<<endl; break;
default:
cout << "Greska" << endl;
}
return 0;
}
Ispis na ekranu:
Index
|