Бодолт илгээх | Бүх бодолтууд | Шилдэг бодолтууд | Жагсаалт руу буцах |
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-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) |
||||||||||||||
2023-03-12 14:30:16
#_tsogtgerel_ nums = input().split() print(int(nums[0])+int(nums[1])+int(nums[2])) Last edit: 2023-03-12 14:34:49 |
||||||||||||||
2023-03-11 05:28:01
#include <cmath> #include <cstdio> #include <vector> #include <iostream> #include <algorithm> #include <math.h> #include <stdio.h> using namespace std; int main() { int a,b,c; cin>>a>>b>>c ; if(a%2==0 && b%2==0 && c%2==1) cout<< "Happy" ; if(a%2==0 && b%2==1 && c%2==0) cout<< "Happy" ; if(a%2==1 && b%2==0 && c%2==0) cout<< "Happy" ; if(b%2==0 && a%2==1 && c%2==1) cout<< "Unhappy" ; if(a%2==0 && b%2==1 && c%2==1) cout<< "Unhappy" ; if(a%2==1 && b%2==1 && c%2==0) cout<< "Unhappy" ; return 0; } |
||||||||||||||
2023-03-10 02:54:25
#include <iostream> using namespace std; int main() { int n,i,s=0,a[1000]; cin>>n; for (i=0;i<n;i++){ cin>>a[i]; } for (i=0;i<n/2;i++){ if (a[i]==a[n-i-1]) s=s+1; } if (s==n/2) cout<<"YES"; else cout<<"NO"; return 0; } |
||||||||||||||
2023-03-06 03:36:37
#include<bits/stdc++.h> using namespace std; int main () { int i,j,q=0,b=1,a[10][10],n,m; scanf("%d" ,&n); for(i=1;i<=n;i++) {for(j=1;j<=n;j++) { }} for(i=1;i<=n;i++) { for(j=1;j<=n;j++) { printf("%3d " ,a[i][j]); } printf("\n"); } return 0; } |
||||||||||||||
2023-03-06 02:26:15
iiiiii iiiiiiii iiiiiiii iiiiii i iii i i i i i i i i i i i i |
||||||||||||||
2023-03-01 06:24:40
#include<bits/stdc++.h> using namespace std; int main(){ int a,b,c,d; scanf("%d%d%d%d",&a, &b, &c, &d); if ((a23+b)%2 ==0 ^ (c+d)%2!=0) printf("YES"); else printf(NO"); } |
||||||||||||||
2023-02-18 07:59:25
if(a==b&&(c==d==e)&&(a!=c)) printf("Full House"); if(a==c&&(b==d==e)&&(a!=e)) printf("Full House"); if(a==d&&(c==b==e)&&(a!=e)) printf("Full House"); if(a==e&&(c==d==b)&&(a!=c)) printf("Full House"); if(c==b&&(a==d==e)&&(a!=c)) printf("Full House"); if(d==b&&(c==a==e)&&(a!=d)) printf("Full House"); if(e==b&&(c==d==a)&&(a!=e)) printf("Full House"); if(d==c&&(a==b==e)&&(a!=c)) printf("Full House"); if(e==c&&(a==d==b)&&(a!=c)) printf("Full House"); if(e==d&&(c==a==b)&&(a!=d)) printf("Full House"); |
||||||||||||||
2023-02-18 07:59:25
if(a==b&&(c==d==e)&&(a!=c)) printf("Full House"); if(a==c&&(b==d==e)&&(a!=e)) printf("Full House"); if(a==d&&(c==b==e)&&(a!=e)) printf("Full House"); if(a==e&&(c==d==b)&&(a!=c)) printf("Full House"); if(c==b&&(a==d==e)&&(a!=c)) printf("Full House"); if(d==b&&(c==a==e)&&(a!=d)) printf("Full House"); if(e==b&&(c==d==a)&&(a!=e)) printf("Full House"); if(d==c&&(a==b==e)&&(a!=c)) printf("Full House"); if(e==c&&(a==d==b)&&(a!=c)) printf("Full House"); if(e==d&&(c==a==b)&&(a!=d)) printf("Full House"); |