This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <conio.h> | |
const int N = 6; | |
main() | |
{ | |
int i, A[N], c; | |
for (i=0; i<N; i++) | |
{ | |
printf("Введите A[%d]: ", i); | |
scanf("%d", &A[i]); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <conio.h> | |
const int N = 10; | |
main() | |
{ | |
int i, j, A[N], c; | |
for (i=0; i<N; i++) { | |
printf("Введите A[%i]: ", i); | |
scanf("%d", &A[i]); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <stdlib.h> | |
#include <conio.h> | |
#include <ctime> | |
const int N = 10; | |
main() | |
{ | |
int i, X, A[N]; | |
int success = 0; // счетчик | |
srand(time(0)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <conio.h> | |
const int N=6; | |
main() | |
{ | |
int i, c, A[N]; | |
for (i=0; i<N; i++) | |
{ | |
printf("Enter A[%d]: ", i); | |
scanf("%d", &A[i]); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <ctime> | |
#include <stdio.h> | |
#include <conio.h> | |
#include <stdlib.h> | |
const int N = 10; //Если float, то (float) rand() / RAND_MAX * (max - min) + min | |
main() //Если integer, то rand()%(max-min+1)+min (концы включаются), а если нет, то 1 прибавлять не надо | |
{ | |
int i, A[N],n1,n2; | |
srand(time(NULL)); //чтобы каждый раз новые числа появлялись | |
for ( i = 0; i < N; i ++ ) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <conio.h> | |
int Prime ( int N ); | |
main() | |
{ | |
int N; | |
printf ( "\nEnter integer: "); | |
scanf ( "%d", &N ); | |
if ( Prime(N) ) | |
printf ( "Integer is simple\n", N ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <conio.h> | |
int Summa(int N) | |
{ | |
int d,sum=0; | |
while(N!=0) | |
{ | |
d=N%10; | |
sum=sum+d; | |
N=N/10; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <conio.h> | |
#include <graphics.h> | |
void Draw ( int x, int y, int color ) | |
{ | |
setfillstyle ( 1, color ); //сплошная заливка, цвет color | |
bar ( x, y, x+20, y+20 ); // залитый прямоугольник | |
} | |
main() | |
{ | |
float x,y; // координаты квадрата |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <conio.h> | |
int MinMax(int a,int b, int &Max) | |
{ | |
if (a>b) {Max=a; return b;} | |
else {Max=b; return a;} | |
} | |
main() | |
{ | |
int N,M,min,max; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
program pi; | |
const c=0.5E-7; | |
var a,sum:real; | |
b:integer; | |
n:longint; | |
begin | |
a:=1.0; | |
sum:=1.0; | |
b:=-1; |
NewerOlder