Untitled
unknown
plain_text
a year ago
12 kB
4
Indexable
#include <bits/stdc++.h> using namespace std; int main() { int opt = 0, a = 0, b = 0, s = 0, p = 0; int selector, o; while (1) { cout << "\t\t\t******************************************************\n"; cout << "\t\t\t PROIECT INFORMATCA RAD DANIEL_IONUT\n"; cout << "\t\t\t******************************************************\n"; cout << "\n\t\t\tEnter <1> to *CHECK IF A NUMBER IS POSITIVE*" << "\n\t\t\tEnter <2> to *VOCAL REPLACEMENT*" << "\n\t\t\tEnter <3> to *SUM OF TWO NUMBERS*" << "\n\t\t\tEnter <4> to *PRODUCT NUMBER TWO*" << "\n\t\t\tEnter <5> to *BIRD LANGUAGE*" << "\n\t\t\tEnter <6> to *VOCATIONAL DOUBLE*" << "\n\t\t\tEnter <7> to *TRANSLATION FROM PASAREASCA*" << "\n\t\t\tEnter <8> to *VOWELS DETERMINATE*" << "\n\t\t\tEnter <9> to *REMOVE CHARACTRES*" << "\n\t\t\tEnter <10> to *SURPRISE*" << "\n\t\t\tEnter <0> to EXIT\n"; cout << "\t\t\t------------------------------\n"; cout << "\t\t\t ENTER YOUR OPTION: \n"; cout << "\t\t\t------------------------------\n"; cin >> selector; opt = selector; if (selector == 0) // cand apas 0 iese din program break; if (selector < 1 or selector > 10) { system("CLS"); cout << "\nPLEASE USE A VALID NUMBER!!!\n"; opt = 0; } while (opt != 0) { if (opt == 1) { int num; cout << "\nEnter a number: "; cin >> num; if (num > 0) cout << "\nThe number is positive\n"; else if (num < 0) cout << "\nThe number is negative\n"; else cout << "\nZero"; cout << "\nDO YOU WANT TO RUN AGAIN? <1>YES <anything>NO\n"; char num2; cin >> num2; if (num2 == '1') opt = 1; else { opt = 0; cin.get(); break; } } if (opt == 2) { int i = 0; char ch[100]; system("CLS"); cout << "\nENTER A STRING WITHOUT SPACES AND PRESS <enter>:\n"; cin >> ch; cout << "\nTHE NEW STRING IS:\n"; while (ch[i] != '\0') { if (ch[i] == 'a') cout << 'A'; else if (ch[i] == 'e') cout << 'E'; else if (ch[i] == 'i') cout << 'I'; else if (ch[i] == 'o') cout << 'O'; else if (ch[i] == 'u') cout << 'U'; else cout << ch[i]; i++; } cout << "\nDO YOU WANT TO RUN AGAIN? <1>YES <anything>NO\n"; char num2; cin >> num2; if (num2 == '1') opt = 2; else { opt = 0; cin.get(); break; } } if (opt == 3) { cout << "\nENTER 2 NUMBERS AND PRESS <enter>:\n"; cin >> a >> b; s = a + b; cout << "\n THE SUM IS: " << s << endl; cout << "\nDO YOU WANT TO RUN AGAIN? <1>YES <anything>NO\n"; char num2; cin >> num2; if (num2 == '1') opt = 3; else { opt = 0; cin.get(); break; } } if (opt == 4) { cout << "\nENTER 2 NUMBERS AND PRESS <enter>:\n"; cin >> a >> b; p = a * b; cout << "\nProdusul = " << p << endl; cout << "\nDO YOU WANT TO RUN AGAIN? <1>YES <anything>NO\n"; char num2; cin >> num2; if (num2 == '1') opt = 4; else { opt = 0; cin.get(); break; } } // pasareasca->romana if (opt == 5) { cout << "\nENTER A STRING WITHOUT SPACES AND PRESS <enter>:\n"; char ch[260]; cin >> ch; int i = 0; cout << "\nTHE NEW STRING IS:\n"; while (ch[i] != '\0') { if ((ch[i] == 'a' || ch[i] == 'e' || ch[i] == 'i' || ch[i] == 'u' || ch[i] == 'o') && ch[i + 1] == 'p' && ch[i + 2] == ch[i]) cout << ch[i], i += 2; else cout << ch[i]; i++; } cout << "\nDO YOU WANT TO RUN AGAIN? <1>YES <anything>NO\n"; char num2; cin >> num2; if (num2 == '1') opt = 5; else { opt = 0; cin.get(); break; } } if (opt == 6) { cout << "\nENTER A STRING WITHOUT SPACES AND PRESS <enter>:\n"; char s[201]; char t[400]; cin >> s; for (int i = strlen(s) - 1; i >= 0; i--) if (strchr("aeiou", s[i]) != NULL) { strcpy(t, s + i); strcpy(s + i + 1, t); } cout << "\nTHE NEW STRING IS:\n"; cout << s; cout << "\nDO YOU WANT TO RUN AGAIN? <1>YES <anything>NO\n"; char num2; cin >> num2; if (num2 == '1') opt = 6; else { opt = 0; cin.get(); break; } } // romana->pasareasca if (opt == 7) { opt = 0; int i = 0; char s[256], v[] = "aeiou"; cout << "\nENTER A STRING WITHOUT SPACES AND PRESS <enter>:\n"; cin >> s; char t[256]; for (i = 0; s[i]; i++) if (strchr(v, s[i])) { strcpy(t, s + i); s[i + 1] = 'p'; strcpy(s + i + 2, t); i += 2; } cout << "\nTHE NEW STRING IS:\n"; cout << s; cout << "\nDO YOU WANT TO RUN AGAIN? <1>YES <anything>NO\n"; char num2; cin >> num2; if (num2 == '1') opt = 7; else { opt = 0; cin.get(); break; } } if (opt == 8) { char s[256], voc[] = "aeiou", cons[] = "bcdfghjklmnpqrstvwxyz"; int nr = 0, i; cout << "\nENTER A STRING WITHOUT SPACES AND PRESS <enter>:\n"; cin >> s; for (i = 1; i < strlen(s) - 1; i++) if (strchr(voc, s[i]) and strchr(cons, s[i - 1]) and strchr(cons, s[i + 1])) nr++; cout << "\nTHE NUMBER OF VOWELS IN BETWEEN 2 CONSONES IS:\n"; cout << nr; cout << "\nDO YOU WANT TO RUN AGAIN? <1>YES <anything>NO\n"; char num2; cin >> num2; if (num2 == '1') opt = 8; else { opt = 0; cin.get(); break; } } if (opt == 9) { char c; char v[100]; cout << "\nENTER A CHARACTER <space> and STRING WITHOUT SPACES AND PRESS <enter>:\n"; cin >> c >> v; int i = 0; cout << "\nTHE STRING WITHOUT THE CHARACTER IS:\n"; while (v[i] != '\0') { if (v[i] != c) { cout << v[i]; } i++; } cout << "\nDO YOU WANT TO RUN AGAIN? <1>YES <anything>NO\n"; char num2; cin >> num2; if (num2 == '1') opt = 9; else { opt = 0; cin.get(); break; } } if (opt == 10) { cout << " :#%+=-: .:-=#%%#%- " << endl; cout << " =%+:-=++####++=--::... ..:::-==++###*+==-:::=%#- " << endl; cout << " :#%-:::::::::.::-=++##%%%%%%%###########%%%%%###++=--:.:::::::::::::+%* " << endl; cout << " =%*:::::::::::::::::::::::::::::::-----::::::::::::::::::::::::::::::::-+#%%#= " << endl; cout << " .##::::::::::::::::::-==+==-.:::::::::::::::::::::::::::::::::::::::::-+#%####%%#. " << endl; cout << " =%*:::::::::::::::--:=@%%%%%+::--:::::::::::::::::::::::::::::::::::-+#%########%%%= " << endl; cout << " #-::::::::::::::=- +. -: .=-:::::::::::::::::::::::::::::.-%%########%#%#%%%%- " << endl; cout << " %-::::::::::::::#+-::=: :=:::#%::::::::::::::::::::::::::=+#%#%############%%%%+: " << endl; cout << " -%%+:::::::::::%%@. :+++++= #%%=::::::::::::::::::::::-+###########%#####%%%%. " << endl; cout << " :+#+:::::::.+%%- +%%%%%%# .%%#.::::::::::::::::::-+###################%%%+: " << endl; cout << " :@:::::.+. .%%%%%%%%+ .+-.::::::::::::::.-%###################%%%*. " << endl; cout << " .+%=::::=: -=::-+%%%%%%*-::=- =.::::::::::::=+######################%%#- " << endl; cout << " :%%:::.+ + :%+. - :-:::::::::.-%#######################%@+ " << endl; cout << " .#%::::==#+: = .-==::::::::-*##########################%%+ " << endl; cout << " .%.:::+%%%#=:--=--:%%%+:::::::=*############################%%%. " << endl; cout << " =%::::::=+#%+ +#*+::::::=+###############################%@- " << endl; cout << " :@-::::::::::-----:::::::-*%#########################%+=#% " << endl; cout << "\nDO YOU WANT TO RUN AGAIN? <1>YES <anything>NO\n"; char num2; cin >> num2; if (num2 == '1') opt = 10; else { opt = 0; cin.get(); break; } } system("CLS"); } } }
Editor is loading...
Leave a Comment