Program x2;
var n:longint;
begin
Write('Введите n, n = ');
Readln(n);
While n mod 2 = 0 do
n:= n div 2;
If n=1 then Write('YES')
else write('NO');
<span>end.</span>
#include <stdio.h>
#define pi 3.14
int main(void){
double S, h, r;
printf("Введите высоту цилиндра: "); scanf("%f", &h);
printf("Введите радиус: "); scanf("%f", &r);
S = 2.0 * pi * h * r;
printf("Площади боковой поверхности цилиндра равна %.2f", S);
return 0;
}
Насчёт С не знаю, но на С++ (а значит, наверное, и на С) так:
#include <iostream>
#include <stdio.h>
using std::cout;
using std::endl;
typedef enum { enSuccess, enWrongCmdLine, enFileOpenError } __ExitCodes;
int main(int argc, char **argv)
{
if(argc != 3) { cout<<"Usage: "<<argv[0]<<" <in_file> <out_file>"<<endl; return enWrongCmdLine; }
FILE *_inFile = fopen(argv[1], "r+b"); if(_inFile == 0) { cout<<"Cannot open input file "<<argv[1]<<endl; return enFileOpenError; }
FILE *_outFile = fopen(argv[2], "w+b");
if(_outFile == 0)
{
cout<<"Cannot open output file "<<argv[2]<<endl;
fclose(_inFile);
return enFileOpenError;
}
char *_buffer[1024];
while(!feof(_inFile) fwrite(_buffer, fread(_buffer, sizeof(_buffer), 1, _inFile), 1, _outFile);
fclose(_inFile); fclose(_outFile);
return enSuccess;
}
Ответ:
a = int(input())
b = int(input())
c = int(input())
s = a + b + c;
print(max(a,b,c))
print(min(a,b,c))
print(s - max(a,b,c) - min(a,b,c))
Объяснение:
Давно не решал. Результат:
1. мяч-->мял-->мал-->мол-->гол.
2. тишь-->тиша-->тяша-->бяша-->баша-->буша-->бура-->буря
3.враг-->врут-->срут-->сруг-->друг
4. тьма-->тема-->темя-->семя-->сеет-->свет