Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int function(char);
- int main()
- {
- char a;
- cout<<"a=:";
- cin>>a;
- cout<<function(a)<<endl;
- system("pause");
- return 0;
- }
- int function(char a)
- {
- int chislo;
- if(a =='a' || a=='A'){
- chislo=1;
- } else if (a =='b' || a=='B'){
- chislo=2;
- } else if (a =='c' || a=='C'){
- chislo=3;
- } else if (a =='d' || a=='D'){
- chislo=4;
- } else if (a =='e' || a=='E'){
- chislo=5;
- } else if (a =='f' || a=='F'){
- chislo=6;
- } else if (a =='g' || a=='G'){
- chislo=7;
- } else if (a =='h' || a=='H'){
- chislo=8;
- } else if (a =='i' || a=='I'){
- chislo=9;
- } else if (a =='j' || a=='J'){
- chislo=10;
- } else if (a =='k' || a=='K'){
- chislo=11;
- } else if (a =='l' || a=='L'){
- chislo=12;
- } else if (a =='m' || a=='M'){
- chislo=13;
- } else if (a =='n' || a=='N'){
- chislo=14;
- } else if (a =='o' || a=='O'){
- chislo=15;
- } else if (a =='p' || a=='P'){
- chislo=16;
- } else if (a =='q' || a=='Q'){
- chislo=17;
- } else if (a =='r' || a=='R'){
- chislo=18;
- } else if (a =='s' || a=='S'){
- chislo=19;
- } else if (a =='t' || a=='T'){
- chislo=20;
- } else if (a =='u' || a=='U'){
- chislo=21;
- } else if (a =='v' || a=='V'){
- chislo=22;
- } else if (a =='w' || a=='W'){
- chislo=23;
- } else if (a =='x' || a=='X'){
- chislo=24;
- } else if (a =='y' || a=='Y'){
- chislo=25;
- } else if (a =='z' || a=='Z'){
- chislo=26;
- }
- return chislo;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement