摘要:
这道题要我们先将10进制数x和y在B进制下进行加法取模运算,然后再将结果转换成10进制。#include<iostream>#include<string.h>using namespace std;const int MAX = 32;int a[MAX], b[MAX];int main(){ int n, cas, B, x, y; cin >> n; while(n --) { cin >> cas >> B >> x >> y; int j = 0; while(x > 0) { a... 阅读全文
posted @ 2011-10-31 14:35
找回失去的
阅读(277)
评论(0)
推荐(1)
摘要:
这道题居然也出现了WA的情况,自己反思下!#include<iostream>using namespace std;int main(){ long long a, b; while( cin >> a >> b) { if( a < b) cout << b - a << endl; else cout << a - b << endl; } return 0;} 阅读全文
posted @ 2011-10-31 09:36
找回失去的
阅读(142)
评论(0)
推荐(0)
摘要:
http://uva.onlinejudge.org/index.php?option=onlinejudge&page=show_problem&problem=1012开始做UVA上的题,然后发现白书推荐了这道题,一看直接上代码吧...#include<stdio.h>int main(){ int v, t; while( scanf( "%d%d", &v, &t) == 2) { printf("%d\n", 2 * v * t); } return 0;} 阅读全文
posted @ 2011-10-31 09:23
找回失去的
阅读(380)
评论(0)
推荐(0)
浙公网安备 33010602011771号