NYOJ628 小媛在努力
2014-03-01 23:07
148 查看
原题链接
简单题。
#include <stdio.h>
int main(){
int t, m, a, b, temp;
scanf("%d", &t);
while(t-- && scanf("%d", &m)){
a = 0;
while(m-- && scanf("%d", &temp)){
if(!a){
b = temp;
a = 1;
continue;
}
if(temp == b) ++a;
else{
printf("%d %d ", a, b);
a = 1;
b = temp;
}
}
printf("%d %d\n", a, b);
}
return 0;
}
简单题。
#include <stdio.h>
int main(){
int t, m, a, b, temp;
scanf("%d", &t);
while(t-- && scanf("%d", &m)){
a = 0;
while(m-- && scanf("%d", &temp)){
if(!a){
b = temp;
a = 1;
continue;
}
if(temp == b) ++a;
else{
printf("%d %d ", a, b);
a = 1;
b = temp;
}
}
printf("%d %d\n", a, b);
}
return 0;
}
相关文章推荐
- nyoj 628 小媛在努力 【搜索】
- NYOJ 628 小媛在努力
- NYOJ628 小媛在努力
- NYOJ 628 小媛在努力
- nyoj 628 小媛在努力= =(水)
- nyoj-628-小媛在努力
- nyoj 628 小媛在努力 【搜索】
- nyoj 628 小媛在努力
- nyoj 628 小媛在努力【大水题】
- NYOJ 628--小媛在努力【水题】
- NYOJ 638 小媛在努力(水)
- NYOJ-682 小媛在努力 (郑大第六届校赛 模拟)
- 628 小媛在努力【水题】
- NYOJ小媛在努力
- 南阳理工628解题报告(小媛在努力)
- 1503172126-ny-小媛在努力
- 小媛在努力
- 小媛在努力
- 小媛在努力学C++
- NYOJ - 628