您的位置:首页 > 其它

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;
}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  NYOJ628