Бодолт илгээх | Бүх бодолтууд | Шилдэг бодолтууд | Жагсаалт руу буцах |
RGB7298 - Анхны тоо |
Өгөгдсөн тоо анхны тоо бол YES үгүй бол NO гэж хэвлэ.
Input
Бүхэл тоо өгөгдөнө.
Output
YES/NO
Example
Input 1:
11
Output 1:
YES
Input 2:
26
Output 2:
NO
Нэмсэн: | Bataa |
Огноо: | 2019-12-10 |
Хугацааны хязгаарлалт: | 1s |
Эх кодын хэмжээний хязгаарлалт: | 50000B |
Memory limit: | 1536MB |
Cluster: | Cube (Intel G860) |
Програмчлалын хэлүүд: | ADA95 ASM32 ASM64 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-08-10 06:31:17
#include <iostream> using namespace std; int main() { int n, i, m=0, a=0; cin >> n; m=n/2; for(i = 2; i <= m; i++) { if(n % i == 0) { cout<<"NO"; a=1; break; } } if (a==0) cout <<"YES"; } |
|||||
2023-02-27 04:03:48
zailllllllllllllllllllllllllllllllll malud |
|||||
2023-02-27 01:56:19
Napoli human after al |
|||||
2022-03-23 05:21:24
#include <iostream> using namespace std; int main() { int n, i, m=0, a=0; cin >> n; m=n/2; for(i = 2; i <= m; i++) { if(n % i == 0) { cout<<"NO"; a=1; break; } } if (a==0) cout <<"YES"; } |
|||||
2022-03-23 05:19:00
uheech |
|||||
2020-03-12 07:59:01
#include <bits/stdc++.h> using namespace std; int main() { int a,i,n; bool b; cin>>n; i=2;b=true; while(i<=trunc(sqrt(n)) && b) if (n%i==0) b=false; else i++; if (b==true ) cout<<"YES"; else cout<<"NO"<<endl; return 0; } |
|||||
2020-01-18 11:46:06
#include <cstdlib> #include <conio.h> #include <iostream> #include <dos.h> #include <windows.h> using namespace std; int x , y , i , j , x1 , y1 , x2 , y2 , urt ,urgun , Score , score; int fruitX , fruitY; int d; bool gameover; void gotoxy (int x, int y){ COORD coordinates; // coordinates is declared as COORD coordinates.X = x; // defining x-axis coordinates.Y = y; //defining y-axis SetConsoleCursorPosition(GetStdHandle(STD_OUTPUT_HANDLE),coordinates); } void Setup() { d = 2; x1 = 10; y1 = 5; urt = 60; urgun = 20; x2 = x1 + urt + 1; y2 = y1 + urgun + 1; score = 100; Score = 0; x = ( x1 + x2 ) / 2; y = ( y1 + y2 ) / 2; fruitX = rand () % urt + x1 + 1; fruitY = rand () % urgun + y1 + 1; gameover=false; } void Draw () { gotoxy ( x2-12 , y1 - 1); printf ( "Score%5d", Score ); gotoxy ( x , y ); printf ( "@" ); gotoxy ( fruitX , fruitY ); printf ( "$" ); gotoxy ( x1 , y1 ); printf ( "%c", 218 ); for ( i = x1 + 1; i < x2; i++ ) { printf ( "%c", 196 ); } printf ( "%c", 191 ); for ( j = y1 + 1; j < y2; j++ ) { gotoxy ( x1 , j ); printf ( "%c", 179 ); gotoxy ( x2 , j ); printf ( "%c", 179 ); } gotoxy ( x1 , y2 ); printf ( "%c", 192 ); for ( i = x1 + 1; i < x2; i++ ) { printf ( "%c", 196 ); } printf ( "%c", 217 ); } void Game () { gotoxy ( x , y ); printf ( " " ); if ( kbhit() ) { switch ( getch () ) { case 72 : d = 1; break; case 77 : d = 2; break; case 80 : d = 3; break; case 75 : d = 4; break; case 27 : gameover = true; break; } } switch (d) { case 1 : { if ( y > y1 + 1) y--; else y = y2 - 1; break; } case 2 : { if ( x < x2 - 1 ) x++; else x = x1 + 1; break; } case 3 : { if ( y < y2 - 1 ) y++; else y = y1 + 1; break; } case 4 : { if ( x > x1 + 1 ) x--; else x = x2 - 1; break; } } gotoxy ( x , y ); printf ( "@" ); if ( x == fruitX && y == fruitY ) { fruitX = rand () % urt + x1 + 1; fruitY = rand () % urgun + y1 + 1; gotoxy ( fruitX , fruitY ); printf ( "$" ); Score = Score + score; gotoxy ( x2 - 7 , y1 - 1); printf ( "%5d", Score ); } Sleep (100); } int main() { Setup(); Draw(); while ( !gameover ) { Game(); } return 0; } |
|||||
2020-01-05 08:10:53
bitgii gorid trash uhagchdaa |
|||||
2019-12-26 07:03:54
shhhhshsshshshhsshshhshshshshhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhshshhssssssssssssssssssssshhhhhhhhhhhhhhhsssssssssshhhhhhhhhhhhhhhhhhssssssssssssssss |
|||||
2019-12-23 06:13:12
#include <iostream> using namespace std; int main() { int a, b; cin >> b; a=1; while( a < b-1 ){ a=a+1; if( b % a == 0 ){ cout << "NO" << endl; return 0; } } cout << "YES" << endl; return 0; } |