Бодолт илгээх | Бүх бодолтууд | Шилдэг бодолтууд | Жагсаалт руу буцах |
RGB7002 - Гурвалжин |
Өгөгдсөн гурвалжны периметрийг ол.
Input
Гурвалжны талууд бүхэл тоогоор нэг мөрөнд зайгаар тусгаарлагдан өгөгдөнө.
Output
Гурвалжны периметр.
Example
Input:
3 4 5
Output:
12
Нэмсэн: | Bataa |
Огноо: | 2011-01-15 |
Хугацааны хязгаарлалт: | 1s |
Эх кодын хэмжээний хязгаарлалт: | 50000B |
Memory limit: | 1536MB |
Cluster: | Cube (Intel G860) |
Програмчлалын хэлүүд: | ADA95 ASM32 BASH BF C NCSHARP CSHARP C++ 4.3.2 CPP C99 CLPS LISP sbcl LISP clisp D ERL FORTRAN HASK ICON ICK JAVA JS-RHINO JULIA LUA NEM NICE OCAML PAS-GPC PAS-FPC PERL PHP PIKE PRLG-swi PYTHON PYPY3 PYTHON3 RUBY SCALA SCM guile ST TCL WHITESPACE |
hide comments
|
||||||||||||||
2023-04-24 05:10:49
molor is super suck Last edit: 2023-04-24 05:11:28 |
||||||||||||||
2023-04-24 05:10:49
molor is suck Last edit: 2023-04-24 05:11:08 |
||||||||||||||
2023-04-18 13:18:13
hi nomgon Last edit: 2023-04-18 13:19:11 |
||||||||||||||
2023-04-18 13:16:10
1 Last edit: 2023-04-18 13:16:45 |
||||||||||||||
2023-04-18 13:16:09
hi sister Last edit: 2023-04-18 13:16:45 |
||||||||||||||
2023-04-13 07:22:56
6 \ |
||||||||||||||
2023-04-06 12:59:48
1 Last edit: 2023-04-18 13:16:52 |
||||||||||||||
2023-03-24 02:52:14
#include <iostream> using namespace std; int main() { int a[1000],n,i,s=0,b[1000],t=0; cin>>n; for (i=1;i<=n;i++) { cin>>a[i]; s+=a[i]; } for (i=1;i<=n;i++) if (s%a[i]==0 && s/a[i]==n) { t=t+1; b[t]=i; } if (t!=0) { cout<<t<<endl; for (i=1;i<=t;i++){ cout<<b[i]<<" "; }} else cout<<0<<endl; cout<<" "; return 0; } |
||||||||||||||
2023-03-23 11:17:50
#include<iostream> using namespace std; int orniitoo(long long n){ int i=0; while(n>0){ i=i+1; n=n/10; } return i; } long long arav(long long p){ int i=0,s=1; while(p>0){ s=s*10; p=p-1; } return s; } int main () { long long o,yui,urdun,yuii,s=0,yuiii,zereg,orongiintoo,n,too[100000],i; scanf("%lld" ,&n); o=n%10; orongiintoo=orniitoo(n); while(orongiintoo>0) { yui=arav(orongiintoo); yuii=yui*9; yuiii=yuii*orongiintoo; s=s+yuiii; printf("%lld\n" ,s); orongiintoo=orongiintoo-1; } //printf("%lld" ,orongiintoo); return 0; } dont forget to solve it |
||||||||||||||
2023-03-21 05:43:20
n=int(input()) s=0 si=1 while n>0: if n%10%2==0: s=s+n%10 else: si=si*(n%10) n=n//10 print(s) print(si) |