Skip to content

Instantly share code, notes, and snippets.

@rpt
Created April 19, 2010 10:09
Show Gist options
  • Save rpt/370890 to your computer and use it in GitHub Desktop.
Save rpt/370890 to your computer and use it in GitHub Desktop.
#include <stdio.h>
int main() {
int weider[43][3], k, i, w, counter;
weider[1][1]=1;
weider[2][1]=2;
weider[3][1]=2;
for (i=4; i<=42; i++) {
weider[i][1]=3;
}
for (i=1; i<=6; i++) {
weider[i][2]=6;
}
w=8;
counter=0;
for (i=7; i<=42; i++) {
weider[i][2]=w;
counter++;
if (counter==4) {
counter=0;
w+=2;
}
}
for (i=1; i<=42; i++) {
printf("\n%2i | %3i | %2i\n", i, weider[i][1], weider[i][2]);
}
printf("Ktory dzien cwiczysz? \n");
scanf("%i", &k);
printf("%i serie po %i powtorzen.\n", weider[k][1], weider[k][2]);
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment