Untitled

 avatar
unknown
plain_text
a year ago
8.6 kB
6
Indexable
#include <bits/stdc++.h>
using namespace std;
int opt, a, b, s, p;
int main()
{
    int i = 1, o;

    while (i)
    {
        system("CLS");
        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 >> i;
        opt=i;
        while (opt != 0)
        {   
            if (opt == 1)
            {opt=0;
                int num = 96;
                if (num > 0)
                    cout << "The number is positive";
                else if (num < 0)
                    cout << "The number is negative";
                else
                    cout << "Zero";
                cin.get();
                cin.get();
               
            }
            if (opt == 2)
            {opt=0;
                char ch[21];
                cin >> ch;
                int i = 0;
                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++;
                }
                cin.get();
                cin.get();
                 
            }
            if (opt == 3)
            {opt=0;
                cin >> a >> b;
                s = a + b;
                cout << "Suma lor este " << s << endl;
                cin.get();
                cin.get();
            }
            if (opt == 4)
            {opt=0;
                cout << "Introduceti numerele:";
                cin >> a >> b;
                p = a * b;
                cout << "Produsul = " << p << endl;
                cin.get();
                cin.get();
              
            }
            // pasareasca->romana
            if (opt == 5)
            {opt=0;
                char ch[260];
                cin.getline(ch, 260);
                int i = 0;
                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++;
                }
                cin.get();
                cin.get();
        
            }
            if (opt == 6)
            {opt=0;
                char s[201];
                char t[201];
                cin.getline(s, 201);
                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 << s;
                cin.get();
                cin.get();
                
            }
            // romana->pasareasca
            if (opt == 7)
            {opt=0;
                int i = 0;
                char s[256], v[] = "aeiou";

                cin.getline(s, 256);
                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 << s;
                cin.get();
                cin.get();
             
            }
            if (opt == 8)
            {opt=0;
                char s[256], voc[] = "aeiou", cons[] = "bcdfghjklmnpqrstvwxyz";
                int nr, i;
                {
                    cin.get(s, 256);
                    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 << nr;
                }
                cin.get();
                cin.get();
        
            }
            if (opt == 9)
            {opt=0;
                char *Trim(char v[]);
                char v[]="bcdfghjklmnpqrstvwxyz";
                int nr, i;
                int contor = 0;
                int contor1 = 0;
                int x = strlen(v);
                int spatiu = ' ';
                while (v[contor1] == spatiu)
                {
                    contor1++;
                }
                strcpy(v, v + contor1);
                x = strlen(v);
                while (v[x - 1] == spatiu)
                {
                    contor++;
                    x--;
                }
                x = strlen(v);
                v[x - contor] = '\0';
                cin.get();
                cin.get();
                
            }
            if (opt == 10)
            {opt=0;
                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;
                
            }
        }
    }
}
Editor is loading...
Leave a Comment