bristolhouse20151001
?>

Написать программу с циклом while (вывести положительные числа кратные 5, которые меньше 1000)

Информатика

Ответы

Любовь-Волков1205
#include < iostream> using namespace std; int main() {     cout < < "enter month num: " < < endl;     unsigned month = 0;     cin > > month;     if (month < = 12 & & month > = 1) {     switch (month / 3)  {     case 1:         cout < < "spring" < < endl;         break;     case 2:         cout < < "summer" < < endl;         break;     case 3:         cout < < "autumn" < < endl;         break;     default:         cout < < "winter" < < endl;         break;     }     } else {       cout < < "no" < < endl;         } return 0; }
svetkinm158
Program textfind; uses strutils; var text,buffer : string; var tpos,lastpos,counter,biggest : integer; begin   tpos : = 0;   text : = '';   while(tpos = 0) do begin     readln(buffer);     text += buffer;     tpos : = pos('.',buffer)   end;   lastpos : = 1;   tpos : = posex(' ',text,lastpos);   if tpos = 0 then      tpos : = posex('.',text,lastpos);   biggest : = tpos-1;   lastpos : = tpos+1;   while(not (tpos = 0)) do begin     tpos : = posex(' ',text,lastpos);     if tpos = 0 then         tpos : = posex('.',text,lastpos);     if (tpos-lastpos) > biggest then         biggest : = tpos-lastpos;       lastpos : = tpos+1;   end;   lastpos : = 1;   counter : = 0;   tpos : = posex(' ',text,lastpos);   if tpos = 0 then     tpos : = posex('.',text,lastpos);   while(not (tpos = 0)) do begin     if (tpos-lastpos) = biggest then         counter += 1;     lastpos : = tpos + 1;     tpos : = posex(' ',text,lastpos);     if tpos = 0 then         tpos : = posex('.',text,lastpos);   end; writeln(counter); end.

Ответить на вопрос

Поделитесь своими знаниями, ответьте на вопрос:

Написать программу с циклом while (вывести положительные числа кратные 5, которые меньше 1000)
Ваше имя (никнейм)*
Email*
Комментарий*

Популярные вопросы в разделе

s45983765471717
ecocheminnov437
Рожнов
eutenkova805
vetviptime
oksanashabanovadc3197
prik-galina7390
tatianamatsimoh
mariyachervonnaya44
Nikolaevich824
Anton661
memmedovallahverdi0239
marver201040
Galina_Yurevna
Shago