123456789101112131415161718192021222324252627282930313233343536373839404142
#include<iostream> #include<string.h> using namespace std; char sprice[10]; int slength, I; char price(char, int); int main() { cout << "\nEnter price: "; cin.getline(sprice, 10); slength = strlen(sprice); price(sprice[10], slength); system("pause>0"); return 0; } char price(char sprice[10], int slength) { for (I = 0; I < slength; I++) { switch (sprice[I]){ case '0': cout << "X"; break; case '1':cout << "C"; break; case '2':cout << "O"; break; case '3':cout << "M"; break; case '4':cout << "P"; break; case '5':cout << "U"; break; case '6':cout << "T"; break; case '7':cout << "E"; break; case '8':cout << "R"; break; case '9':cout << "S"; break; case '.':cout << "."; break; } } return sprice[I]; }
char price(char sprice[10], int slength)
price(sprice, slength);
char price(char[], int);