14-masalainput faylida nol va birlardan tashkil topgan satr berilgan.
Satrdagi birlar
miqdorini output fayliga yozish dasturini tuzing.
#include
#include
using namespace std;
int i=0, schet, num=0, dlina; char stroka[101];
int main()
{ ifstream in("INPUT.TXT");
in >> stroka;
in.close();
dlina=strlen(stroka);
while (iif (stroka[i] == 0) schet+=1;
else schet=0;
if (schet>num) num=schet;
i+=1; }
ofstream out("OUTPUT.TXT");
out << num;
out.close();
return 0;} #include
#include
using namespace std;
int i=0, schet, num=0, dlina; char stroka[101];
int main()
{ ifstream in("INPUT.TXT");
in >> stroka;
in.close();
dlina=strlen(stroka);
while (iif (stroka[i] == 0) schet+=1;
else schet=0;
if (schet>num) num=schet;