摘要:
简单题View Code #include <iostream>#include <cstdlib>#include <cstring>#include <cstdio>using namespace std;int main(){ //freopen("D:\\t.txt", "r", stdin); int n, k; while (scanf("%d%d", &n, &k) != EOF) { int ans = n + (n / (k - 1)); if (n % 阅读全文
posted @ 2011-04-30 15:57
undefined2024
阅读(179)
评论(0)
推荐(0)
摘要:
简单题View Code #include <iostream>#include <cstdlib>#include <cstring>#include <cstdio>using namespace std;int count(int x){ int ret = 0; while (x > 0) { if (x % 2 == 1) ret++; x /= 2; } return ret;}int main(){ //freopen("D:\\t.txt", "r", stdin); int n; w 阅读全文
posted @ 2011-04-30 15:47
undefined2024
阅读(213)
评论(0)
推荐(0)
摘要:
简单题View Code #include <iostream>#include <cstdlib>#include <cstring>#include <cstdio>#include <cmath>using namespace std;int main(){ //freopen("D:\\t.txt", "r", stdin); int n; scanf("%d", &n); int m = floor(sqrt(n * 2)); int ans = 0; fo 阅读全文
posted @ 2011-04-30 15:32
undefined2024
阅读(151)
评论(0)
推荐(0)
摘要:
字符串处理,还是用string类比较容易,先将字符串用million和thousand切分成三段,然后用同样的方法处理这三段即可。注意输入数据结尾有多余空行View Code #include <iostream>#include <cstdlib>#include <cstring>#include <cstdio>using namespace std;string name[] ={ "one", "two", "three", "four", "fi 阅读全文
posted @ 2011-04-30 14:58
undefined2024
阅读(328)
评论(0)
推荐(0)