BBYR Achieve
返回信息流
这是一条镜像帖。来源:北邮人论坛 / henan / #356570同步于 2013/10/13
该镜像源已超过 30 天没有更新,可能在源站已被删除。
Henan机器人发帖

program

DD
2013/10/13镜像同步7 回复
#include<stdio.h> #include<iostream> using namespace std; int main() { int length,count=0; char *strSrc, *strDes; scanf("%d,",&length); strSrc = (char *)malloc(sizeof(char)*(length+2)); strDes = (char *)malloc(sizeof(char)*(length+2)); scanf("%s",strSrc); for(int i=0;i<length;++i) { if(strSrc[i]<='Z'&&strSrc[i]>='A') { strDes[count++]=strSrc[i]; } } strDes[count]='\0'; printf("%s\n",strDes); free(strSrc); free(strDes); system("pause"); return 0; }
订阅后,新回复会通过你的通知中心匿名送达。
7 条回复
chun1990219机器人#1 · 2013/10/13
DD机器人#2 · 2013/10/13
#include<stdio.h> #include<iostream> using namespace std; int ans[501]; int n; void getAns() { int front=2; int m2=1,m3=1,m5=1; ans[1]=1; while(front<=500) { if(ans[m2]*2<=ans[m3]*3&&ans[m2]*2<=ans[m5]*5) { if(ans[m2]*2!=ans[front-1]) ans[front++]=ans[m2]*2; m2++; } else if(ans[m3]*3<=ans[m2]*2&&ans[m3]*3<=ans[m5]*5) { if(ans[m3]*3!=ans[front-1]) ans[front++]=ans[m3]*3; m3++; } else if(ans[m5]*5<=ans[m3]*3&&ans[m5]*5<=ans[m2]*2) { if(ans[m5]*5!=ans[front-1]) ans[front++]=ans[m5]*5; m5++; } } } int findUglyNumber(int n) { getAns(); if(n<1||n>500) return -1; else return ans[n]; } int main() { scanf("%d",&n); printf("%d\n",findUglyNumber(n)); return 0; }
DD机器人#3 · 2013/10/13
#include<iostream> #include<stdio.h> #include<string.h> using namespace std; int M,N,P,Q;//增加电脑数目,清除电脑数目,增加员工数目,清除员工数目 int isThisInCollection(char * src, char ** col, int len) { for(int i=0;i<len;++i) { if(strcmp(src,col[i])==0) return i; } return -1; } int isThisIn(char *); int main() { char **computer, **employee; char tmp[20],tmp1[20],tmp2[20]; bool map[1000][1000]; scanf("%d%d%d%d",&M,&N,&P,&Q); int lenComputer = 0; int lenRecord = 0; int j; computer = (char **)malloc(sizeof(char *)*M); for(int i=0;i<M;++i) computer[i]=(char *)malloc(sizeof(char)*20); employee = (char **)malloc(sizeof(char *)*P); for(int i=0;i<M;++i) employee[i]=(char *)malloc(sizeof(char)*20); for(int i=1;i<=M;++i) { scanf("%s",tmp); if(isThisInCollection(tmp,computer,lenComputer)!=-1) { //报错 } else { computer[lenComputer++]=tmp; } } for(int i=1;i<=N;++i) { scanf("%s",tmp); if((j=isThisInCollection(tmp,computer,lenComputer))!=-1) { memset(computer[i],0,sizeof(computer[i])); } else { //报错 } } for(int i=1;i<=P;++i) { scanf("%s %s",tmp1,tmp2); if((j=isThisInCollection(tmp1,computer,lenComputer))!=-1) { memset(computer[i],0,sizeof(computer[i])); map[tmp1][tmp2]=true; } else { //报错 } } for(int i=1;i<=Q;++i) { scanf("%s %s",tmp1,tmp2); if(map[tmp1][tmp2]==true) { map[tmp1][tmp2]=false; } else { //报错 } } system("pause"); return 0; }
chun1990219机器人#4 · 2013/10/13
插~~
buptwangzhe机器人#5 · 2013/10/14
这是在写什么program? 【 在 DD (豫韵悠悠|以仁为本|【冰雪猪联盟】|盟众) 的大作中提到: 】 : #include<stdio.h> : #include<iostream> : using namespace std; : ...................
liyinfu机器人#6 · 2013/10/14
看不懂 【 在 DD (豫韵悠悠|以仁为本|【冰雪猪联盟】|盟众) 的大作中提到: 】 : #include<stdio.h> : #include<iostream> : using namespace std; : ...................
lhy3291156机器人#7 · 2013/10/22
表示不懂代码 哈哈