摘要: #include "stdio.h"int main(int argc, char* argv[]){ int index,sum; char c; scanf("%d",&index); getchar(); while (index--) { sum =0 ; while ( (c= getchar())!= '\n') { if (c < 0 ) sum++; } printf("%d\n",sum/2); } return 0;}以上是转的别人的代码!可以AC过去!#include <cst 阅读全文
posted @ 2012-07-30 13:46 Marshalkk 阅读(1467) 评论(1) 推荐(0)
摘要: #include <cstdlib>#include <iostream>#include <string>using namespace std;int main(int argc, char *argv[]){ int flag,n,len; char str[50]; cin>>n; getchar(); while(n--) { flag=1; gets(str); len=strlen(str); len=len-1; for(int i=0;i<len;i++) { //cout<<"len="& 阅读全文
posted @ 2012-07-30 11:34 Marshalkk 阅读(240) 评论(0) 推荐(0)
摘要: #include <cstdlib>#include <iostream>using namespace std;int main(int argc, char *argv[]){ int n; int dividend,max,a[100]={0}; while(cin>>n) { max=0; for(int i=0;i<n;i++) { cin>>a[i]; if(a[i]>max) max=a[i]; } dividend=max; loop:for(int i=0;i<n;i++) { //cout<<&q 阅读全文
posted @ 2012-07-30 10:58 Marshalkk 阅读(382) 评论(0) 推荐(0)
摘要: #include <cstdlib>#include <iostream>#include <string>using namespace std;int main(int argc, char *argv[]){ int A,E,I,O,U,n,len; char str[100]; cin>>n; getchar(); while(n--) { A=0; E=0; I=0; O=0; U=0; gets(str); len=strlen(str); for(int i=0;i<len;i++) { if(str[i]=='a&# 阅读全文
posted @ 2012-07-30 10:48 Marshalkk 阅读(338) 评论(0) 推荐(0)