PDF Archive

Easily share your PDF documents with your contacts, on the Web and Social Networks.

Share a file Manage my documents Convert Recover PDF Search Help Contact



code .pdf


Original filename: code.pdf

This PDF 1.4 document has been generated by VeryPDF Free Text To PDF Converter v1.5 / VeryPDF.com Inc (http://www.verypdf.com), and has been sent on pdf-archive.com on 10/06/2016 at 21:03, from IP address 182.68.x.x. The current document download page has been viewed 258 times.
File size: 2 KB (2 pages).
Privacy: public file




Download original PDF file









Document preview


/*
ID: ******
PROG: gift1
LANG: C++
*/
#include <iostream>
#include <fstream>
#include <string.h>
using namespace std;
int main() {
ofstream fout ("gift1.out");
ifstream fin ("gift1.in");
int n,j,account[10],z,y;
for(int i=0;i<10;i++)
account[i]=0;
fin>>n;
char name[10][10];
for(int i=0;i<n;i++)
{
fin>>name[i];
}
int people[10],money[10];
char temp[10];
for(int i=0;i<n;i++)
{fin>>temp;
for(j=0;j<n;j++)
{
if(strcmp(name[j],temp)==0)
{
fin>>money[j]>>people[j];
break;
}
}
account[j]-=money[j];
if(people[j]==0)
{
z=0;
y=money[j];
}

else
{
y=money[j]%people[j];
z=(money[j]-y)/people[j]; }
account[j]+=y;
for(int k=0;k<people[j];k++)
{
fin>>temp;
for(int g=0;g<n;g++)
{
if(strcmp(name[g],temp)==0)
{
account[g]+=z;
break;
}
}
}
}
for(int i=0;i<n;i++)
{
fout<<name[i]<<" "<<account[i]<<endl;
}
return 0;
}


code.pdf - page 1/2
code.pdf - page 2/2

Related documents


code
arma 3 sqf cheat sheet revision 3
diy versus professional tax accountants1603
go wild casino bonus review
opgaveh fte c output
getting tax accountant support can1555


Related keywords