随笔分类 -  模拟

hdu 1259(模拟)
摘要://模拟#include <cstdio>#include <iostream>using namespace std;void swap(char &a, char &b) { char temp = a; a = b; b = temp;}int main() { int t, i; scanf ("%d", &t); while (t--) { int n, x, y; char s[9] = {"#ZJUTACM"}; scanf ("%d", &n); for (i=0 阅读全文
posted @ 2012-04-05 21:40 Try86 阅读(157) 评论(0) 推荐(0)
hdu 1020(模拟)
摘要://模拟#include <cstdio>#include <cstring>#include <iostream>using namespace std;char str[10001];void solve() { int l = strlen(str); int c = 1; char ch = str[0]; for (int i=1; i<l; ++i) { if (ch == str[i]) ++c; else { if (c > 1) printf ("%d%c", c, ch); el... 阅读全文
posted @ 2012-04-04 11:43 Try86 阅读(143) 评论(0) 推荐(0)
hdu 1013(模拟)
摘要://模拟,注意题中没有给出数据的大小#include <cstdio>#include <cstring>#include <iostream>using namespace std;char n[1005];int solve() { int sum = 0; int l = strlen(n); for (int i=0; i<l; ++i) sum += n[i] - '0'; if (sum > 9) { int s, m; s = m = sum; sum = 0; while (s > 9) { ... 阅读全文
posted @ 2012-04-04 09:44 Try86 阅读(131) 评论(0) 推荐(0)