Бодолт илгээх | Бүх бодолтууд | Шилдэг бодолтууд | Жагсаалт руу буцах |
ABR0061 - Бүхэл ба бутархай |
x бодит тоо өгөгдөв. x тооны бүхэл хэсэг, x-д хамгийн ойр бүхэл тоо болон x тооны таслалаас өмнөх хэсгийг ол.
Input
x бодит тоо өгөгдөнө
Output
x тооны бүхэл хэсэг, x-д хамгийн ойр бүхэл тоо болон x тооны таслалаас өмнөх хэсгийг тус бүрийг нь нэг мөрөнд хэвлэнэ
Example
Input: 1.6 Output: 1 2 1
Нэмсэн: | sw40 |
Огноо: | 2007-10-22 |
Хугацааны хязгаарлалт: | 1s |
Эх кодын хэмжээний хязгаарлалт: | 50000B |
Memory limit: | 1536MB |
Cluster: | Cube (Intel G860) |
Програмчлалын хэлүүд: | Бүгд дараах хэлүүдээс бусад: ASM32-GCC MAWK BC C-CLANG NCSHARP CPP14 CPP14-CLANG COBOL COFFEE D-CLANG D-DMD DART ELIXIR ERL FANTOM FORTH GOSU GRV JS-RHINO JS-MONKEY JULIA KTLN NIM NODEJS OBJC OBJC-CLANG OCT PERL6 PICO PROLOG PYPY PYPY3 PY_NBC R RACKET RUST CHICKEN SQLITE SWIFT UNLAMBDA VB.NET |
Эх сурвалж: | Абрамов С. А. |
hide comments
|
||||||
2012-10-03 08:13:50 Anand
#include <stdio.h> #include <math.h> #include <stdlib.h> main() { double a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z; scanf("%lf",&x); n = x; z = 0; if (x > 0){ while(x >= 1){ x = x -1; z++; } if (x <= 0.5) y = n - x; else y = n - x +1; printf("%.0lf\n%.0lf\n%.0lf",z,y,z); } else{ while (x <= 0){ x = x + 1; z--; } if (x <= 0.5) y = n - x; else y = n - x + 1; printf("%.0lf\n%.0lf\n%.0lf",z,y,z+1); } system("pause"); } |
||||||
2012-04-18 07:54:40 Munhk-Erdene
Buruu shvv aldaag zasaad bicheerei |
||||||
2012-04-18 07:54:07 Munhk-Erdene
#include <stdio.h> #include <conio.h> main () { int i,n; scanf ("%d",&n); for(i=1;i<=n;i++); printf("%d",n); getch(); } |
||||||
2010-12-13 15:43:44 Piotr KÄ…kol
Congratulations. :-) And 2 more tests: 100.0001 -> 100 100 100 100.4 -> 100 100 100 |
||||||
2010-12-13 11:29:53 Batzorig
finally i got AC thanks Piotr :) |
||||||
2010-12-13 07:31:54 Batzorig
mine cs_sansar@yahoo.com.......i added u buddy :D |
||||||
2010-12-12 17:34:32 Piotr KÄ…kol
Last edit: 2010-12-13 15:40:48 |
||||||
2010-12-10 17:16:33 Batzorig
i cant find my mistake :)) can u give your id ? yahoo etc |
||||||
2010-12-09 07:03:32 Batzorig
hmm can u give more pls :D my program printing all of them correct :D but still says wrong answer :D |
||||||
2010-12-08 22:32:45 Piotr KÄ…kol
7.00001 -> 7 7 7 7.0000 -> 6 7 7 -7.00001 -> -8 -7 -7 -7.00000 -> -8 -7 -7 -7.50000 -> -8 -8 -7 -0.6 -> -1 -1 0 0.6 -> 0 1 0 1 -> 0 1 1 -1 -> -2 -1 -1 Write if You need more or want answer for any test. ;-) |