488 Presentation error

All about problems in Volume 4. If there is a thread about your problem, please use it. If not, create one with its number in the subject.

Moderator: Board moderators

Post Reply
matthewagent
New poster
Posts: 2
Joined: Sat Feb 25, 2017 7:18 pm

488 Presentation error

Post by matthewagent » Sat Feb 25, 2017 7:22 pm

Hi guys, I kept getting presentation error on question 488, and I have no idea how to fix it,although I've already check everything about the format....
Can anyone help me out? Thanks a lot!!!

Code: Select all

#include <iostream>
using namespace std;

int main()
{
	int n;
	int A, F;
	cin >> n;
	cout << endl;

	while (n > 0) {

		cin >> A >> F;
		cout << endl;

		while (F > 0) {
			int i, j;
			for (i = 1;i <= A;i++) {
				for (j = 0;j < i;j++) {
					cout << i;
				}
				cout << endl;
			}

			for (i = (A - 1);i > 0;i--) {
				for (j = i;j > 0;j--) {
					cout << i;
				}
				cout << endl;
			}
			F--;
			if (F != 0) {
				cout << endl;
			}
		}
		n--;
		if (n != 0) {
			cout << endl;
		}
		
	}
	return 0;
}

User avatar
sohel
Guru
Posts: 856
Joined: Thu Jan 30, 2003 5:50 am
Location: New York

Re: 488 Presentation error

Post by sohel » Sat Feb 25, 2017 8:53 pm


Post Reply

Return to “Volume 4 (400-499)”