今天来聊聊关于从键盘输入一个小于1000的正数流程图,从键盘输入一个小于1000的正数的文章,现在就为大家来简单介绍下从键盘输入一个小于1000的正数流程图,从键盘输入一个小于1000的正数,希望对各位小伙伴们有所帮助。
1、123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869#include #include using namespace std; int n; int main(){ scanf("%d", &n); int v = n/100; if (v == 9) printf("Nine hundred"); else if (v == 8) printf("Eight hundred"); else if (v == 7) printf("Seven hundred"); else if (v == 6) printf("Six hundred"); else if (v == 5) printf("Five hundred"); else if (v == 4) printf("Four hundred"); else if (v == 3) printf("Three hundred"); else if (v == 2) printf("Two hundred"); else if (v == 1) printf("One hundred"); if (!(n%100)) { printf("."); return 0; } printf(" and "); v = (n/10)%10; if (v == 9) printf("ninety "); else if (v == 8) printf("eighty "); else if (v == 7) printf("seventy "); else if (v == 6) printf("sixty "); else if (v == 5) printf("fifty "); else if (v == 4) printf("forty "); else if (v == 3) printf("thirty "); else if (v == 2) printf("twenty "); if (v == 1) { v = n%10; if (v == 9) printf("nineteen"); else if (v == 8) printf("eighteen"); else if (v == 7) printf("seventeen"); else if (v == 6) printf("sixteen"); else if (v == 5) printf("fifteen"); else if (v == 4) printf("fourteen"); else if (v == 3) printf("thirteen"); else if (v == 2) printf("twelve"); else if (v == 1) printf("eleven"); else if (v == 0) printf("ten"); } if ((n/10)%10 != 1) { v = n%10; if (v == 9) printf("nine"); else if (v == 8) printf("eight"); else if (v == 7) printf("seven"); else if (v == 6) printf("six"); else if (v == 5) printf("five"); else if (v == 4) printf("four"); else if (v == 3) printf("three"); else if (v == 2) printf("two"); else if (v == 1) printf("one"); } printf("."); return 0;}幸苦打的。
2、望采纳。
相信通过从键盘输入一个小于1000的正数这篇文章能帮到你,在和好朋友分享的时候,也欢迎感兴趣小伙伴们一起来探讨。