Back
Chuyen_So_Sang_Chu.cpp
Save
// Chuyen_So_Sang_Chu.cpp #include
#include
using namespace std; char* chuyenSoSangChu(char so) { switch (so) { case '0': return "khong"; case '1': return "mot"; case '2': return "hai"; case '3': return "ba"; case '4': return "bon"; case '5': return "nam"; case '6': return "sau"; case '7': return "bay"; case '8': return "tam"; case '9': return "chin"; default: return ""; } } void xoaKyTu(char str[255], int k) { for (int i = k; i < strlen(str); i++) str[i] = str[i+1]; } void chenKyTu(char str[255], char x, int k) { int n = strlen(str); for (int i = n; i > k ; i--) str[i] = str[i-1]; str[k] = x; str[n+1] = '\0'; } int main() { char str[100], str1[100]; char* chuSo; int in = 0, thuong = 0, so = 0; cout<<"Nhap str: "; fflush(stdin); gets(str); for (int i = 0; i < strlen(str); i++) { if (isupper(str[i])) in++; if (islower(str[i])) thuong++; if (isdigit(str[i])) so++; } cout<<"Chuoi vua nhap co "<