1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
|
#include <iostream>
#include <string>
using namespace std;
int pancakes[9];
string amount = "How many pankcakes did person ";
int main ()
{
std::cout<<"Welcome to my panckae project!"<<std::endl;//This project will teach me the use of arrays and help me with user input and output
for (int x=1;x<=10;x++)
{
std::cout<<amount<<x<<" eat? ";
cin>>pancakes[x];
}
int a=1;
int numofpan = pancakes[0, 1, 2, 3, 4, 5, 6, 7, 8, 9];
for (numofpan=pancakes[0, 1, 2, 3, 4, 5, 6, 7, 8, 9];numofpan<=10;numofpan++)
{
std::cout<<"Person "<<a++<<" ate: "<<pancakes[numofpan]<<" pancakes\n";
}
std::cin.get();
}
|