Advertisement
Guest User

Untitled

a guest
Oct 19th, 2019
140
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.41 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int function(char);
  5.  
  6. int main()
  7. {
  8. char a;
  9. cout<<"a=:";
  10. cin>>a;
  11. cout<<function(a)<<endl;
  12. system("pause");
  13. return 0;
  14. }
  15.  
  16. int function(char a)
  17. {
  18. int chislo;
  19. if(a =='a' || a=='A'){
  20. chislo=1;
  21. } else if (a =='b' || a=='B'){
  22. chislo=2;
  23. } else if (a =='c' || a=='C'){
  24. chislo=3;
  25. } else if (a =='d' || a=='D'){
  26. chislo=4;
  27. } else if (a =='e' || a=='E'){
  28. chislo=5;
  29. } else if (a =='f' || a=='F'){
  30. chislo=6;
  31. } else if (a =='g' || a=='G'){
  32. chislo=7;
  33. } else if (a =='h' || a=='H'){
  34. chislo=8;
  35. } else if (a =='i' || a=='I'){
  36. chislo=9;
  37. } else if (a =='j' || a=='J'){
  38. chislo=10;
  39. } else if (a =='k' || a=='K'){
  40. chislo=11;
  41. } else if (a =='l' || a=='L'){
  42. chislo=12;
  43. } else if (a =='m' || a=='M'){
  44. chislo=13;
  45. } else if (a =='n' || a=='N'){
  46. chislo=14;
  47. } else if (a =='o' || a=='O'){
  48. chislo=15;
  49. } else if (a =='p' || a=='P'){
  50. chislo=16;
  51. } else if (a =='q' || a=='Q'){
  52. chislo=17;
  53. } else if (a =='r' || a=='R'){
  54. chislo=18;
  55. } else if (a =='s' || a=='S'){
  56. chislo=19;
  57. } else if (a =='t' || a=='T'){
  58. chislo=20;
  59. } else if (a =='u' || a=='U'){
  60. chislo=21;
  61. } else if (a =='v' || a=='V'){
  62. chislo=22;
  63. } else if (a =='w' || a=='W'){
  64. chislo=23;
  65. } else if (a =='x' || a=='X'){
  66. chislo=24;
  67. } else if (a =='y' || a=='Y'){
  68. chislo=25;
  69. } else if (a =='z' || a=='Z'){
  70. chislo=26;
  71. }
  72. return chislo;
  73. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement