hdu 1106(字符串处理+排序)
摘要:View Code /* Name: 字符串处理+排序 Copyright: Author: Try86 Date: 17/04/12 07:12 Description: */#include <cstdio>#include <cstring>#include <cstdlib>#include <iostream>using namespace std;const int N = 505;int num[N];int cmp(const void *a, const void *b) { return *(int *)a - *(int *
阅读全文
posted @
2012-04-17 19:49
Try86
阅读(145)
推荐(0)
hdu 1860(字符串处理)
摘要:/* Author: Try_86 Date: 11/04/12 18:28 Description: 字符串处理 */#include <cstdio>#include <cstring>#include <iostream>using namespace std;char pat[6], str[81];struct node { char c; int num;}s[5];void solve() { int lenP = strlen(pat); int lenS = strlen(str); for (int i=0; i<5; ++i) s
阅读全文
posted @
2012-04-11 18:30
Try86
阅读(220)
推荐(0)
hdu 1062(字符串处理)
摘要://字符串处理#include <cstdio>#include <cstring>#include <iostream>using namespace std;char text[1005];void solve() { int l = strlen(text); int i, j, k; for (i=0; i<l; ) { if (text[i] != ' ') { for (j=i; text[j]!=' ' && j<l; ++j); for (k=j-1; k>=i; --k) p
阅读全文
posted @
2012-04-06 20:45
Try86
阅读(163)
推荐(0)
hdu 1219(字符串处理)
摘要://简单字符串处理#include <cstdio>#include <cstring>#include <iostream>using namespace std;char text[100005];int s[26];int main() { while (gets(text)) { int l = strlen(text); int i; for (i=0; i<26; ++i) s[i] = 0; for (i=0; i<l; ++i) ++s[text[i]-'a']; for (i=0; i<26; ++i...
阅读全文
posted @
2012-04-04 20:13
Try86
阅读(219)
推荐(0)