Бодолт илгээх | Бүх бодолтууд | Шилдэг бодолтууд | Жагсаалт руу буцах |
ABR136D - Квадратуудын нийлбэр |
n натурал тоо ба a1, ..., an бодит тоонууд өгөгдөв. Илэрхийллийн утгыг ол:
Input
n натурал тоо ба a1, ..., an бодит тоонууд хоорондоо зай болон мөр шилжүүлэх тэмдэгтээр тусгаарлагдан өгөгдөнө.
Output
дээрх илэрхийллийн утгыг таслалаас хойш нэг оронгийн нарийвчлалтайгаар бодож гаргана
Example
Input: 3 3.14 9.81 0.5 Output: 106.3
Нэмсэн: | sw40 |
Огноо: | 2007-12-29 |
Хугацааны хязгаарлалт: | 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
2024-02-16 06:37:43
#include <iostream> #include <vector> #include <algorithm> using namespace std; int main() { int n, k, p; cin >> n >> k >> p; vector<int> a(n); for (int i = 0; i < n; ++i) { cin >> a[i]; } // Remove the k-th element a.erase(a.begin() + k - 1); // Add p to the end a.push_back(p); // Sort the array sort(a.begin(), a.end()); // Print the modified array for (int i = 0; i < n; ++i) { cout << a[i] << " "; } cout << endl; return 0; } |
|
2020-06-19 12:19:23
#include <stdio.h> #include <math.h> int main () { int n; scanf("%d", &n); double a, re; int b; b = 0; re = 0; while(b < n ) { scanf("%lf", &a); b++; re = re + a * a; } printf("%.1lf", re); return 0; } |
|
2019-02-01 15:21:39
#include <cstdio> int main() { int a,i; double b[1000],s=0; scanf("%d",&a); for(i=1;i<=a;i++){ scanf("%lf",&b[i]); b[i]=b[i]*b[i]; s+=b[i]; } printf("%.1lf",s); return 0; } |
|
2013-02-11 10:44:41 M.Enkhbileg
#include <iostream> #include <stdlib.h> using namespace std; main() { int n; double d, s=1, s2=0; cin >> n; while(n--) { cin >> d; s = d * d; s2 += s; } cout.setf(ios::fixed|ios::showpoint); cout.precision(1); cout << s2; system("pause"); return 0; } |
|
2012-02-29 10:30:33 AiR-Stark (DMTS) 10c
Хойлог Ариунбаяр |
|
2011-09-04 05:50:07 hw10d208
#include<stdio.h> int main() { double a,n,c; c=0; scanf("%lf",&n); while(n--){ scanf("%lf",&a); c+=a*a; } printf("%.1lf\n",c); system("pause"); return 0; } |
|
2009-09-22 07:38:35 Morningstar
yaj n shirheg a1 a2 a3 ... an too oruulah ym be |