1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
|
#include <iostream>
#include <iomanip>
#include <string>
using namespace std;
double receiptmake(string item1, double priceitem1, string item2, double priceitem2, string item3, double priceitem3, string item4, double priceitem4, string item5, double priceitem5)
{
double item1length= item1.length();
double item2length= item2.length();
double item3length= item3.length();
double item4length= item4.length();
double item5length= item5.length();
int looptimes;
std::left;
cout << setw(20) << item1;
looptimes=20-item1length;
for(looptimes; looptimes=0; -looptimes){
cout << ".";
}
cout << endl;
cout << looptimes;
return 0;
}
int main()
{
receiptmake("Example",5,"a",5,"a",3,"a",4,"a",5);
}
|