Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // for-schleife.cpp : Definiert den Einstiegspunkt für die Konsolenanwendung.
- //
- #include "stdafx.h"
- #include "iostream"
- #include <cmath>
- using namespace std;
- int main() {
- const int hoehe = 9;
- const int breite = 9;
- int b[hoehe][breite];
- int i = 0;
- int c = 0;
- for(int x = 0; x < breite + 1; x++) {
- for(int y = 0; y < hoehe + 1; y++) {
- b[x][y] = i +1 ;
- c = c + b[x][y];
- cout << b[x][y] << endl;
- cout << c << endl;
- i++;
- }
- }
- system("pause");
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement