摘要:
#include#includechar s[20];int is_prime(int x){ int n; sprintf(s,"%d",x); n=strlen(s); for(int i=0;i"); printf("%d",num[j]); } break; } cnt++; } printf("\n"); } return 0;} 阅读全文
摘要:
#includeint main(){char c,d;int n,N;scanf("%d",&N);getchar();//回车符要处理;while(N--){ n=1; d=getchar(); while((c=getchar())!='\n') { if(c==d){n++;} else{if(n==1)printf("%c",d); elseprintf("%d%c",n,d);d=c;n=1; } } if(n==1) printf("%c\n",d); else printf( 阅读全文
摘要:
#include#includedouble area(double x0,double y0,double x1,double y1,double x2,double y2){ return fabs((x0*y1+x2*y0+x1*y2-x2*y1-x0*y2-x1*y0));}int main(){ double x0, y0, x1, y1,x2, y2,S; int n; int count; scanf("%d",&n); while(n--) { count=0; scanf("%lf%lf%lf%lf%lf%lf",&x0 阅读全文
摘要:
#includeint is_prime(int x){ for(int i=2;i*i<=x;i++) if(x%i==0) return 0; return 1;}int prime[200],cnt=0;void get_prime(){ for(int i=2;i<=100;i++) if(is_prime(i)) prime[cnt++]=i;}int main(){ get_prime(); for(int i=0;i<cnt;i++) printf("%d ",prime[i]); return 0;} 阅读全文