#include <iostream>
#include <fstream>
using namespace std;
int main(){
ofstream f2;
f2.open("/Users/admin/Desktop/train/output.txt",ios::out);
const int len = 2, string = 3;
const char ch = '\n';
char mass[len][strings];
int order[] = { 0, 1, 2, 1, 2, 1 }; ////
ifstream fs("/Users/admin/Desktop/train/input.txt", ios::in | ios::binary);
int i = 0;///
for(int r = 0; r<strings; r++) { fs.getline(mass[r], len-1,ch); Read lines into the array } for (int i="0;" mass[len][order[i % 6]]!="0;" i++) 6]]--; cout<< mass[len][0]<<mass[len][1]<< mass[len][2]<<endl; cout << endl; }< code></strings;></fstream></iostream>
br><br>
but gives me 3 blank lines and then zero.<br><br>
Please help me to solve this problem
N := min(A, int(B/2), C);
A := AN; B := B-N*2; C := C-N;
N := N*4;
if A > 0 then
N := N+1;
if B > 0 then
N := N+1;
if C > 0 then
N := N+1;
Find more questions by tags C++
#include
#include
using namespace std;
int main()
{
ifstream fin("input.txt");
ofstream fin2("output.txt");
int order[] = { 0, 1, 2, 1, 2, 1 };
vases int[3];
int a,b,c;
fin>>a;
fin>>b;
fin>>c;
vases[0]=a;
vases[1]=b;
vases[2]=c;
int i;
for (i = 0; vases[order[i % 6]]!= 0; i++){
vases[order[i % 6]]--;
}
fin2< - karli.Kub commented on June 10th 19 at 16:59