User Tools

Site Tools


dydaktyka:cprog:2016:test1-solutions

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
dydaktyka:cprog:2016:test1-solutions [2016/12/01 09:19]
pkleczek
— (current)
Line 1: Line 1:
-~~NOTRANS~~ 
- 
-====== Kolokwium 1 – rozwiązania ====== 
- 
-===== Grupa A ===== 
- 
-==== Zadanie 1 ==== 
- 
-<code c test1a-1.c>​ 
-#include <​stdio.h>​ 
-#include <​stdlib.h>​ 
- 
-int main() 
-{ 
-    int rok; 
- 
-    printf("​Podaj rok: "); 
-    scanf("​%d",​ &rok); 
- 
-    if ((rok % 4 == 0 && rok % 100 != 0) || (rok % 400 == 0)) { 
-        printf("​Rok przestepny\n"​);​ 
-    } else { 
-        printf("​Rok nieprzestepny\n"​);​ 
-    } 
- 
-    return 0; 
-} 
-</​code>​ 
- 
-===== Grupa B ===== 
- 
-<code c test1b-1.c>​ 
-#include <​stdio.h>​ 
-#include <​stdlib.h>​ 
- 
-int main() 
-{ 
-    int q; 
- 
-    printf("​Podaj q: "); 
-    scanf("​%d",​ &q); 
- 
-    if (20 <= q && q < 40 && q % 3 == 0) { 
-        printf("​q spelnia zaleznosc\n"​);​ 
-    } else { 
-        printf("​q nie spelnia zaleznosci\n"​);​ 
-    } 
- 
-    return 0; 
-} 
-</​code>​ 
  
dydaktyka/cprog/2016/test1-solutions.1480580360.txt.gz · Last modified: 2020/03/25 11:46 (external edit)