Advertisement
Guest User

floydas

a guest
Feb 1st, 2015
185
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.44 KB | None | 0 0
  1. #include "stdafx.h"
  2. #include<stdio.h>
  3. #include<iostream>
  4.  
  5. int _tmain(int argc, _TCHAR* argv[])
  6. {
  7. int i, j, k = 1;
  8. int zakres;
  9.  
  10. printf("Wprowadz ilosc lini w ktorych ma zostac wygenerowany trojkad floyd'a: ");
  11. scanf("%d", &zakres);
  12.  
  13. printf("\nTrojkat Floyd'a: \n");
  14.  
  15. for (i = 1; i <= zakres; i++) {
  16. for (j = 1; j <= i; j++, k++) {
  17. printf(" %d", k);
  18. }
  19. printf("\n");
  20. }
  21. system("pause");
  22. return 0;
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement