UVA 10785 (暑假-排序、检索(2)-E-The Mad Numerologist )
来源:互联网 发布:windows whistler安装 编辑:程序博客网 时间:2024/05/16 19:15
#include <stdio.h>#include <string.h>#include <stdlib.h>#include <algorithm>using namespace std;int main() {char sound[] = {"AUEOI"};char consonant[] = {"JSBKTCLDMVNWFXGPYHQZR"};int t, k = 0;scanf("%d", &t);while (k++ < t) {printf("Case %d: ", k);int n;scanf("%d", &n);int sorted_sound[250];int sorted_consonant[250];int j = 0, l = 0;for (int i = 0; i < n; i++) {if (i%2 == 0)sorted_sound[j++] = sound[i/42];elsesorted_consonant[l++] = consonant[i/10];}sort(sorted_sound,sorted_sound + j);sort(sorted_consonant,sorted_consonant + l);int count_1 = 0;int count_2 = 0;for (int i = 0; i < n; i++) {if (i%2 == 0)printf("%c", sorted_sound[count_1++]);elseprintf("%c", sorted_consonant[count_2++]);}printf("\n");}return 0;}
0 0
- UVA 10785 (暑假-排序、检索(2)-E-The Mad Numerologist )
- 排序检索-10785 - The Mad Numerologist
- UVa 10785 The Mad Numerologist (排序)
- uva 10785 The Mad Numerologist(遍历+sort排序)
- uva 10785 The Mad Numerologist(字符串)
- uva 10785 The Mad Numerologist
- uva 10785 - The Mad Numerologist
- UVA 10785 - The Mad Numerologist
- Uva 10785 - The Mad Numerologist
- uva 10785The Mad Numerologist
- UVa 10785 - The Mad Numerologist
- UVA 10785 The Mad Numerologist
- UVA 10785 - The Mad Numerologist
- uva 10785 The Mad Numerologist
- UVa 10785 - The Mad Numerologist
- UVa:10785 - The Mad Numerologist
- UVa 10785 - The Mad Numerologist
- UVa 10785 - The Mad Numerologist
- UVA 755 (暑假-排序、检索(2)-D-487--3279 )
- 分组背包
- 财政监督期刊杂志投稿怎么样
- 对触摸精灵的封装(按钮)及其回调函数
- 9月份入读哈工大计算机研究生了
- UVA 10785 (暑假-排序、检索(2)-E-The Mad Numerologist )
- ubuntu中taglist和ctags安装,简单明了
- 扩展的卡特兰数
- Android source download
- DNS
- Spring官网改版后下载
- 记一次MongoDB性能问题
- UVA 400 (暑假-排序、检索(2)-F- Unix ls)
- 北邮新生排位赛4解题报告