269 条题解
-
0hello12345 LV 3 @ 2007-02-01 15:10:31
弱题
-
02006-12-02 01:39:22@
编译通过...
├ 测试数据 01:答案正确... 0ms
├ 测试数据 02:答案正确... 0ms
├ 测试数据 03:答案正确... 0ms
├ 测试数据 04:答案正确... 0ms
├ 测试数据 05:答案正确... 0ms
---|---|---|---|---|---|---|---|-
Accepted 有效得分:100 有效耗时:0ms555555...之前程序没保存就提交,错了N次,AC率爆降吖..
-
02006-11-17 20:26:21@
编译通过...
├ 测试数据 01:答案正确... 0ms
├ 测试数据 02:答案正确... 0ms
├ 测试数据 03:答案正确... 0ms
├ 测试数据 04:答案正确... 0ms
├ 测试数据 05:答案正确... 0ms
---|---|---|---|---|---|---|---|-
Accepted 有效得分:100 有效耗时:0ms -
02006-11-04 09:21:32@
编译通过...
├ 测试数据 01:答案正确... 0ms
├ 测试数据 02:答案正确... 0ms
├ 测试数据 03:答案正确... 0ms
├ 测试数据 04:答案正确... 0ms
├ 测试数据 05:答案正确... 0ms
---|---|---|---|---|---|---|---|-
Accepted 有效得分:100 有效耗时:0ms -
02006-10-21 21:12:36@
基础题,考察repeat(或do-while)循环的使用....
(感觉到了baidu的pascal吧...) -
02006-10-04 19:24:16@
C++一定要用double啊!!
用float过不了 -
02006-09-14 13:41:22@
我晕这怎么能是题呢?去上小朋友做都行
朋友加我QQ:370639067 -
02006-08-24 22:17:25@
我晕,还以为数据会恨变态 原来这么简单
-
02006-08-22 09:48:14@
EXTENDED!——人间正道!
-
02006-08-19 14:26:56@
天哪,为什么偶的程序过不了.郁闷死我了...
说什么被0除,郁闷...这测评机有BUG!! -
02006-08-12 17:04:28@
用C的最搞笑了:
我用float型不过,改成double就过了!!! -
02006-07-28 15:59:54@
longint足矣。。。。。。。
-
02006-07-21 22:08:19@
太简单了。
FREE PASCAL的可以用CARDINAL类型做。
要是当年碰到这么简单的就好了。 -
02006-04-30 22:42:03@
死算,用extended
-
-12018-08-05 22:16:42@
#include <stdio.h> #include <stdlib.h> #include <math.h> int main() { long double s = 0,n = 1; int i,k; scanf("%d",&k); while(s <= k) { s += 1/n; n = n + 1; } printf("%d",(int)(n-1)); return 0; }
-
-12018-07-23 11:37:56@
C++AC标程:
#include <iostream>
using namespace std;
int main()
{
int k,n=0;
double s=0;//注意和要定义成浮点型
cin>>k;
while (s<=(k*1.0))//(k*1.0)是把k强制类型转换成浮点型
{
n++;
s+=1.0/n;//注意是浮点数的1(1.0),不是整型的1
}//这个循环需要初学者上机调试
cout<<n<<endl;
return 0;
} -
-12018-07-09 16:08:23@
#include<stdio.h>
#include<string.h>
int main()
{
int k;
scanf("%d",&k);
double sum = 0.0;
int i = 1;
do
{
sum = sum + 1.0/i;
i++;
//printf("%f\n", 1 / i);
} while (sum<=k);
printf("%d\n", i-1);
return 0;
} -
-12018-04-23 20:59:59@
??
-
-12018-03-19 14:55:24@
Java版
import java.util.Scanner;
public class Main
{
public static void main(String[] args)
{
Scanner scan=new Scanner(System.in);
int k=scan.nextInt();
double a=0;
int n=0;
a:for(double i=1.0;;i++)
{
a+=1/i;
if(a>k)
{
n=(int) i;
break a;
}
}
System.out.println(n);
}
} -
-12018-02-07 20:51:01@
#include<iostream>
using namespace std;
int main(){
int a[11],i,k=0,x=0,g;
for(i=0;i<12;i++)
cin>>a[i];
i=0;
while(i<12){
k=300-a[i]+k;
if(k>100){
g=k%100;
x=x+k-g;
k=g;}
if(k<0){
x=-i-1;
break;}
i++;
}
if(x>0){
x=x*1+0.2*x;
cout<<x;
}
else
cout<<x;
}