自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(22)
  • 收藏
  • 关注

原创 房间安排

不知道为什么一是WA。#include #include const int MAX = 10000 + 10;using namespace std;typedef struct{ int a; int b; int c;}node;int compare(const void* node0, const void* node1){ return ((node*)no

2014-11-04 21:18:35 196

原创 盗梦空间

#include #include using namespace std;int main(){ int t; cin>>t; while(t--) { int m, s = 0, mult = 1; cin>>m; while(m--) { char ch[10]; cin>>ch; if(!strcmp(ch, "IN")) mu

2014-11-04 19:15:16 382

原创 字符串替换

#include #include const int MAX = 1000+10;using namespace std;int main(){ char ch[MAX]; while(cin.getline(ch, MAX)) { int n = strlen(ch); for(int i = 0; i <= n-1-2; i++) { if(!strnc

2014-11-03 23:09:15 259

原创 分数加减法

这题的关键是列出各种计算结果的情况:结果为0,

2014-11-03 22:26:30 262

原创 两点距离

#include #include using namespace std;int main(){ int n; cin>>n; while(n--) { double x0, y0, x1, y1; cin>>x0>>y0>>x1>>y1; cout.precision(2); cout<<fixed<<sqrt(pow(abs(x1-x0),2)+pow(a

2014-11-03 21:21:57 228

原创 1的个数

#include using namespace std;int main(){ int n; cin>>n; while(n--) { int k; cin>>k; int i = 0; while(k) { k=k&(k-1); i++; } cout<<i<<endl; } return 0;}

2014-11-03 21:16:00 214

原创 成绩转换

#include using namespace std;int main(){ int n; cin>>n; while(n--) { int k; cin>>k; if(k>=90) cout<<"A"<<endl; else if(k>=80) cout<<"B"<<endl; else if(k>=70) cout<<"C"<<end

2014-11-03 21:12:10 223

原创 兄弟郊游问题

#include using namespace std;int main(){ int n; cin>>n; while(n--) { double m, x, y, z; cin>>m>>x>>y>>z; cout.precision(2); cout<<fixed<<m*x/(y-x)*z<<endl; } return 0;}

2014-11-03 21:07:10 208

原创 n-1位数

#include using namespace std; int main(){ int n; cin>>n; while(n--) { int k, m; cin>>k; m = k; int i = 1; while(k/10) { k/=10; i*=10; } if(i==1) cout<<0<<endl; else

2014-11-03 21:00:19 205

原创 开灯问题

#include #include using namespace std;int A[1010];int main(){ int m, n; memset(A, 0, 1010*sizeof(int)); cin>>m>>n; for(int i = 1; i <= n; i++) { for(int j = 1; j <= m; j++) { if(j%i

2014-11-03 20:44:31 259

原创 日期计算

#include using namespace std;const int DAYS[] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};bool isLeapyear(int year){ if(year%100) if(year%4==0)return true; else return false; else

2014-11-03 20:31:43 205

原创 小学生算术

#include using namespace std;int main(){ int m, n; while(cin>>m>>n, m&&n) { int i = 0; int a0, a1, b0, b1, c0, c1; a0 = m%10; b0 = m/10%10; c0 = m/100%10; a1 = n%10; b1 = n/10%10

2014-11-03 19:09:48 270

原创 鸡兔同笼

这个问题就是解二元一次方程组:x+y=

2014-11-03 18:34:43 332

原创 笨小熊

用getchar()一个个从输入流取字符居然超时。

2014-11-02 17:18:01 235

原创 谁获得了最高奖学金

思路和测试都是对的啊,不知道为ac不了

2014-11-02 16:21:59 226

原创 6174问题

#include using namespace std;void getK(int k, int& times){ int a, b, c, d; a = k%10; b = k/10%10; c = k/100%10; d = k/1000%10; if(a<b) { int t = a; a = b; b = t; } if(c<d) { int

2014-11-02 10:55:09 312

原创 阶乘因式分解(一)

#include using namespace std;int getK(int m, int n){ int i = 0; while(true) { if(m%n==0) { i++; m/=n; } else break; } return i;}int main(){ int T, m, n, i; cin>>T; fo

2014-11-02 00:10:49 209

原创 三个数从小到大排序

#include using namespace std;int main(){ int a, b, c; cin>>a>>b>>c; if(a>b) { a=a^b; b=a^b; a=a^b; } if(b>c) { b=b^c; c=b^c; b=b^c; } if(a>b) { a=a^b; b=a^b; a=a^b; }

2014-11-01 23:39:25 368

原创 公倍数和公约数

#include using namespace std;int GCD(int i, int j){ if(i<j) { int t = i; i = j; j = t; } if(j==0) return i; else return GCD(j, i%j);}int LCM(int i, int j){ return i*j/GCD(i, j

2014-11-01 23:32:28 241

原创 水仙花数

#include using namespace std;bool isDaffodils(int n){ int a, b, c; a = n%10; b = n/10%10; c = n/100%10; if(n==a*a*a+b*b*b+c*c*c) return true; else return false;}int main(){ int n; w

2014-11-01 23:21:29 239

原创 韩信点兵

#include using namespace std;int main(){ int a, b, c; cin>>a>>b>>c; for(int i = 10; i < 100; i++) { if(i%3==a&&i%5==b&&i%7==c) { cout<<i<<endl; break; } } //system("PAUSE"); re

2014-11-01 23:04:48 311

原创 蛇形填数

这题关键是找准起点,

2014-11-01 21:38:06 300

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除