Бодолт илгээх | Бүх бодолтууд | Шилдэг бодолтууд | Жагсаалт руу буцах |
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
|
||||||||||||||
2024-03-28 03:25:58
zzdc Last edit: 2024-03-28 03:40:45 |
||||||||||||||
2024-03-28 03:25:55
A Last edit: 2024-03-28 03:40:27 |
||||||||||||||
2024-03-28 03:25:33
ttfgyh Last edit: 2024-03-28 03:40:50 |
||||||||||||||
2024-03-28 03:25:25
A Last edit: 2024-03-28 03:40:35 |
||||||||||||||
2024-03-28 03:25:11
A Last edit: 2024-03-28 03:40:42 |
||||||||||||||
2024-03-21 02:47:08
A Last edit: 2024-03-28 03:44:35 |
||||||||||||||
2024-03-20 02:57:53
#include<iostream> using namespace std; string solve(string s){ string s1; int k = 0; for(int i = 0; i < s.size() -1; i++){ if(s[i] == s[i + 1]){ k++; } else{ if(k == 0) s1 += s[i]; k = 0; } } if(k == 0) s1 += s[s.size() - 1]; return s1; } int main(){ string s, str[1000]; int index = 0; cin>>s; int l = 1; s = solve(s); str[index] = s; while(l == 1){ index++; s = solve(s); str[index] = s; for(int i = 0; i < index - 1; i++) if(str[index - 1] == str[i]) l = 0; } cout << s; } |
||||||||||||||
2024-03-20 02:30:57
#include <iostream> using namespace std; int nemeh(int n[] ,int s){ cout<<"too oruulna uu"<<endl; cin>>n[s]; return n[s]; } int hasah(int n[], int s){ cout<<"top too hasagdlaa"<<endl; n[s]=-10; return n[s]; } void hevleh(int n[], int s){ cout<<"Tanii buteesn matrix:"<<endl; for(int i=0; i<s; i++) cout<<n[i]<<" "; } int main() { int k[100000]; int b=100, p=0; while (b!=3){ cout<<"too oruulah bol 1 hasah bol 2 matrixiig hevleh bol 3 gj ilgeene uu"<<endl; cin>>b; if(b==1){ nemeh(k, p); p++; } if(b==2){ hasah(k, p); p--; } if(b==3){ hevleh(k, p); } } return 0; } |
||||||||||||||
2024-03-20 02:02:06
#include <stack> #include <iostream> #include <vector> #include <algorithm> using namespace std; #define MAX 10 string bush(char x){ string ci; return ci; } void zurag(int too, int mx){ for(int j = mx;j >= 1;j--){ if(j<=too){ cout <<'|'; for(int i =5;i>=1;i--){ cout <<"-"; } cout <<'|'<<endl; } else{ cout <<'|'; for(int i =5;i>=1;i--){ cout <<" "; } cout <<'|'<<endl; } } for(int i=7;i>=1;i--){ cout <<'_'; } } int main() { int size, s= 0; stack <string> chips; char key ,def; cout <<" hemjee: "; cin >> size; while(cin >> key) switch(key){ case '1': if(s == 0){ s++; } cin >> def; chips.push(bush(def)); break; case '2': cout << chips.size()<<endl; break; case '3': cout << size - chips.size()<<endl; break; case '4': cout << chips.top()<<endl; break; case '5': zurag(chips.size(),size); break; case '6': chips.pop(); break; default: cout <<"Error"; } } |
||||||||||||||
2024-03-19 04:55:54
yr ni bl amidrl gyshde amdrh ghr sahntrd shantrh gher hetsu hetsu gj bdhr hetsu bdg hetsu gj bdhgu bvl yr nil gy shde hahahahahahahahahahahahahahahahahahahah yuc yrcu hahahhahahahaahahhhahhahaahahhhahahahhahahaehahaahhaeaeh |