Skip to content

Instantly share code, notes, and snippets.

View MaratB's full-sized avatar

Marat MaratB

View GitHub Profile
#include <stdio.h>
#include <string.h>
#include <conio.h>
main(){
char s[80];
FILE *fp;
int x,y;
fp = fopen("input.txt", "r");
while (fgets(s,80,fp))
#include <stdio.h>
#include <string.h>
#include <conio.h>
main(){
char s[80], word[30].
*p;
int count=0, len;
printf("Enter sentence: %s\n", s );
gets(s);
#include <conio.h>
#include <stdio.h>
#include <string.h>
main(){
char s[80]= "Война и Мир", *p,
a[80]= "Гитара",
str[]= "ар",
ch= 'и';
p = strchr(s,ch);
#include <conio.h>
#include <stdio.h>
#include <string.h>
main(){
char s[80],
a[80]="Привет, ";
int n=0, len;
printf("Введите фамилию и имя: \n");
gets(s);
#include <conio.h>
#include <stdio.h>
#include <string.h>
main(){
char s[80];
int i=0;
printf("Введите имя файла: \n");
gets(s);
while ((s[i] != '.') &&(s[i] !='\0')) // ищем точку или конец строки
#include <stdio.h>
#include <conio.h>
#include <string.h>
main()
{
char pass[] = "пароль", // правильный пароль
s[80];
printf ("Введите пароль:\n ");
gets(s);
if ( strcmp ( pass, s )){
#include <ctime>
#include <stdio.h>
#include <conio.h>
#include <stdlib.h>
const int N = 10;
main() {
int i,j, A[N],nmin,c,m,L=0,R=N-1,x,flag;
srand(time(NULL));
for ( i = 0; i < N; i ++ )
A[i] = rand()%(21)-10;
@MaratB
MaratB / снег
Last active December 23, 2015 16:49
#include <graphics.h>
#include <conio.h>
#include <stdlib.h>
int random (int N) { return rand() % N; }
main()
{
int x, y, R, G, B;
initwindow (500, 500);
while ( ! kbhit () ) //пока не нажата клавиша
{
#include <conio.h>
#include <graphics.h>
void Draw ( int x, int y, int color )
{
setfillstyle ( 1, color );
bar ( x, y, x+20, y+20 );
}
main()
{
int x,y,code,dx,dy;
#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()
{
int x,y,code;