Бодолт илгээх | Бүх бодолтууд | Шилдэг бодолтууд | Жагсаалт руу буцах |
RGB7090 - Шагай |
k ширхэг шагайг орхиход /хаяхад/ буух ялгаатай боломжийн тоог ол. Шагай нь морь, тэмээ, хонь, ямаа гэсэн 4 янзаар бууна.
Input
Шагайны тоо өгөгдөнө.
Output
Ялгаатай буултын тоо.
Example
Input: 4 Output: 35
Нэмсэн: | Bataa |
Огноо: | 2013-01-14 |
Хугацааны хязгаарлалт: | 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-11-18 07:58:42
#include<bits/stdc++.h> using namespace std; int main() { int n,i,b,c,s=0; cin>>n; for (i=0; i<=n; i++) { for (b=0; b<=n; b++) for (c=0; c+b+i<=n; c++){ s++; } } cout<<s; } teegi anda av |
|||||||||||
2024-05-20 04:47:06
#include <iostream> #include <sstream> #include <string> #include <cstdlib> #include <cmath> using namespace std; // Headers string toString (double); int toInt (string); double toDouble (string); int main() { int a, bol, n, i, j; bol = 1; i = 2; n = 1; cin >> a; for (j = 1; j <= a; j++) { n = n + i; bol = bol + n; i = i + 1; } cout << bol << endl; return 0; } // The following implements type conversion functions. string toString (double value) { //int also stringstream temp; temp << value; return temp.str(); } int toInt (string text) { return atoi(text.c_str()); } double toDouble (string text) { return atof(text.c_str()); } #include <iostream> #include <sstream> #include <string> #include <cstdlib> #include <cmath> using namespace std; // Headers string toString (double); int toInt (string); double toDouble (string); int main() { int a, bol, n, i, j; bol = 1; i = 2; n = 1; cin >> a; for (j = 1; j <= a; j++) { n = n + i; bol = bol + n; i = i + 1; } cout << bol << endl; return 0; } // The following implements type conversion functions. string toString (double value) { //int also stringstream temp; temp << value; return temp.str(); } int toInt (string text) { return atoi(text.c_str()); } double toDouble (string text) { return atof(text.c_str()); } #include <iostream> #include <sstream> #include <string> #include <cstdlib> #include <cmath> using namespace std; // Headers string toString (double); int toInt (string); double toDouble (string); int main() { int a, bol, n, i, j; bol = 1; i = 2; n = 1; cin >> a; for (j = 1; j <= a; j++) { n = n + i; bol = bol + n; i = i + 1; } cout << bol << endl; return 0; } // The following implements type conversion functions. string toString (double value) { //int also stringstream temp; temp << value; return temp.str(); } int toInt (string text) { return atoi(text.c_str()); } double toDouble (string text) { return atof(text.c_str()); } #include <iostream> #include <sstream> #include <string> #include <cstdlib> #include <cmath> using namespace std; // Headers string toString (double); int toInt (string); double toDouble (string); int main() { int a, bol, n, i, j; bol = 1; i = 2; n = 1; cin >> a; for (j = 1; j <= a; j++) { n = n + i; bol = bol + n; i = i + 1; } cout << bol << endl; return 0; } // The following implements type conversion functions. string toString (double value) { //int also stringstream temp; temp << value; return temp.str(); } int toInt (string text) { return atoi(text.c_str()); } double toDouble (string text) { return atof(text.c_str()); } #include <iostream> #include <sstream> #include <string> #include <cstdlib> #include <cmath> using namespace std; // Headers string toString (double); int toInt (string); double toDouble (string); int main() { int a, bol, n, i, j; bol = 1; i = 2; n = 1; cin >> a; for (j = 1; j <= a; j++) { n = n + i; bol = bol + n; i = i + 1; } cout << bol << endl; return 0; } // The following implements type conversion functions. string toString (double value) { //int also stringstream temp; temp << value; return temp.str(); } int toInt (string text) { return atoi(text.c_str()); } double toDouble (string text) { return atof(text.c_str()); } #include <iostream> #include <sstream> #include <string> #include <cstdlib> #include <cmath> using namespace std; // Headers string toString (double); int toInt (string); double toDouble (string); int main() { int a, bol, n, i, j; bol = 1; i = 2; n = 1; cin >> a; for (j = 1; j <= a; j++) { n = n + i; bol = bol + n; i = i + 1; } cout << bol << endl; return 0; } // The following implements type conversion functions. string toString (double value) { //int also stringstream temp; temp << value; return temp.str(); } int toInt (string text) { return atoi(text.c_str()); } double toDouble (string text) { return atof(text.c_str()); } #include <iostream> #include <sstream> #include <string> #include <cstdlib> #include <cmath> using namespace std; // Headers string toString (double); int toInt (string); double toDouble (string); int main() { int a, bol, n, i, j; bol = 1; i = 2; n = 1; cin >> a; for (j = 1; j <= a; j++) { n = n + i; bol = bol + n; i = i + 1; } cout << bol << endl; return 0; } // The following implements type conversion functions. string toString (double value) { //int also stringstream temp; temp << value; return temp.str(); } int toInt (string text) { return atoi(text.c_str()); } double toDouble (string text) { return atof(text.c_str()); } #include <iostream> #include <sstream> #include <string> #include <cstdlib> #include <cmath> using namespace std; // Headers string toString (double); int toInt (string); double toDouble (string); int main() { int a, bol, n, i, j; bol = 1; i = 2; n = 1; cin >> a; for (j = 1; j <= a; j++) { n = n + i; bol = bol + n; i = i + 1; } cout << bol << endl; return 0; } // The following implements type conversion functions. string toString (double value) { //int also stringstream temp; temp << value; return temp.str(); } int toInt (string text) { return atoi(text.c_str()); } double toDouble (string text) { return atof(text.c_str()); } #include <iostream> #include <sstream> #include <string> #include <cstdlib> #include <cmath> using namespace std; // Headers string toString (double); int toInt (string); double toDouble (string); int main() { int a, bol, n, i, j; bol = 1; i = 2; n = 1; cin >> a; for (j = 1; j <= a; j++) { n = n + i; bol = bol + n; i = i + 1; } cout << bol << endl; return 0; } // The following implements type conversion functions. string toString (double value) { //int also stringstream temp; temp << value; return temp.str(); } int toInt (string text) { return atoi(text.c_str()); } double toDouble (string text) { return atof(text.c_str()); } |
|||||||||||
2024-05-13 04:46:36
po Last edit: 2024-05-13 04:47:16 |
|||||||||||
2024-05-10 06:22:24
#include <iostream> using namespace std; int main(){ int k,s=1,i,j,t=1,p; cin>>k; for(i=1;i<=k+3;i++){ s=s*i; } for(j=1;j<=k;j++){ t=t*j; } p=s/t/6; cout<<p; } |
|||||||||||
2024-04-26 14:37:44
Yoo ene med zui hiisnes tiktok odorjin uzh ymsan <3 |
|||||||||||
2024-04-23 02:57:22
#include <iostream> #include <math.h> using namespace std; int main(){ double a; double sol, ex, lol; cin >> a; ex = a + 3; double result1 = pow(ex, 3); double result2 = pow(ex, 2); sol = 2 * ex; lol = result1 - (3 * result2) + sol; cout << lol / 6 << endl; } |
|||||||||||
2024-04-08 03:48:17
boooooom2 |
|||||||||||
2024-03-29 02:39:39
#include <iostream> using namespace std; int main() { int a,b,c,d,i,j,s,h; cin>>a; s=a+3; h=a; c=1; for(i=1; i<=s; i++){ c=c*i; } b=1; for(j=1; j<=a; j++){ b=b*j; } d=(double) c / (b*6); cout<<d<<endl; return 0; } |
|||||||||||
2024-03-13 07:32:25
shangrilagin urd zogsoh hun? |
|||||||||||
2024-03-06 10:35:56
yeeeeeee 35 bish 36shdee boli2 ichih heregtei |