acm_字符串
GrimCake
这个作者很懒,什么都没留下…
展开
-
UVa-10905 Children's Game
给定n个整数,把他们连接成一个最大的整数,如123,124,56,90连接成9056124123 考虑:先将其进行排序,比如先取两个数啊a,b,若 a+b>b+a 则 把其合成ab的形式再与其他数字用相同的方法进行比较,合成,最后的结果一定是最大的 #include #include #include using namespace std; bool cmp(string a,string原创 2017-02-05 22:37:41 · 280 阅读 · 0 评论 -
UVa-10304 All in All
#include #include using namespace std; int main(){ char s[100001],t[100001]; int k; while(cin>>s>>t){ k=0; for(int i=0;i<strlen(t);i++){ if(s[k]==t[i]) k++; } if(strlen(s)<=strlen(t)&&原创 2017-02-03 23:09:58 · 179 阅读 · 0 评论 -
UVa-10361 Automatic Poetry
#include #include #define MAX 100+1 using namespace std; void getss(char s[]){ for(int i=0;i<MAX;i++){ if((s[i]=getchar()) == '' || s[i] == '\n'){ s[i]='\0'; break; } } } int main() { ch原创 2017-03-11 22:02:15 · 284 阅读 · 0 评论 -
NYOJ-218 Dinner(字符串判断)
水题 #include #include #include using namespace std; int main() { int n,sum,flag[1000]; char a[1000][12]; char b[4][14]={"bowl","knife","fork","chopsticks"}; while(cin>>n) { sum=0;原创 2017-03-16 22:42:12 · 282 阅读 · 0 评论