上一页 1 ··· 14 15 16 17 18
2012年8月21日

UVA644-立即可解码性

摘要: #include #include #include using namespace std;int com(const void *a , const void *b){ return strlen(((char *)a))- strlen(((char *)b));}int main (){ char b[9][15]; char c; int num = 0; while(1) { int i = 0, j = 0; num++; while(c = cin.get()) { ... 阅读全文
posted @ 2012-08-21 10:21 Primo... 阅读(120) 评论(0) 推荐(0)

UVA621-秘密研究

摘要: #include #include using namespace std;int main (){// string a[3] = {"135","435","7835"};// string b[3] = {"914","944","9784"};// string c[3] = {"1901","1904","19078"};// string d[3] = {"1","4&quo 阅读全文
posted @ 2012-08-21 10:21 Primo... 阅读(122) 评论(0) 推荐(0)

UVA591-一盒砖

摘要: #include using namespace std;int main (){ int n; int count = 0; while(cin>>n) { count++; if(!n)break; int a[n]; int sum = 0; for(int i = 0; i >a[i]; sum+=a[i]; } sum/=n; int min = 0; for(int i = 0; i sum) ... 阅读全文
posted @ 2012-08-21 10:21 Primo... 阅读(121) 评论(0) 推荐(0)

UVA579-时钟的指示

摘要: #include #include using namespace std;int main (){ int h, m; double a1, a2,angle; char c; while(cin>>h>>c>>m) { if(!h&&!m)break; if(h==12)h = 0; a1 = (h+m/60.0)*30.0; a2 = m*6.0; angle = a2 - a1; //cout"; ... 阅读全文
posted @ 2012-08-21 10:21 Primo... 阅读(115) 评论(0) 推荐(0)

UVA1122-clock

摘要: 此题的难点是表盘的规律,时针和分针相遇的时刻是60*hour/11,还有,常疏忽的地方是第一行和最后一行的两句话、#include #include using namespace std;int main (){ cout>a>>b>>c>>d) { int n = c - a; if(n==0&&d<b) n+=11; if(n<0)n += 11; n += 13; if(((60*(a)/11))<b)n -= 1; if(c==12)n-=1; else if(d<((60*... 阅读全文
posted @ 2012-08-21 10:20 Primo... 阅读(152) 评论(0) 推荐(0)

UVA846-步数

摘要: #include using namespace std;int main (){ int m, n; int num; cin>>num; while(num--) { cin>>m>>n; int dis, step = 0; dis = n - m; if(dis == 0) { cout<<0<<endl; continue; } int k = 0; for(k = 0; k*k <= dis; k+... 阅读全文
posted @ 2012-08-21 10:20 Primo... 阅读(119) 评论(0) 推荐(0)
上一页 1 ··· 14 15 16 17 18