mirror of
https://github.com/pepaskopec-blip/Graduately.git
synced 2026-10-27 23:24:34 +00:00
Add a C# course with a side-by-side code runner.
Each lesson explains a topic and runs the edited program next to the text through the local .NET SDK. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
parent
6662eb185e
commit
333085ee53
86 changed files with 2482 additions and 5 deletions
40
content/programovani/1-rocnik/04-typy.md
Normal file
40
content/programovani/1-rocnik/04-typy.md
Normal file
|
|
@ -0,0 +1,40 @@
|
|||
---
|
||||
id: cs-1-typy
|
||||
nazev: Datové typy
|
||||
popis: int, double, bool, char a string.
|
||||
---
|
||||
|
||||
# Výklad
|
||||
|
||||
## Čísla
|
||||
*int a double*
|
||||
|
||||
- int je celé číslo: 42.
|
||||
- double je číslo s desetinnou tečkou: 3.14.
|
||||
- V kódu je desetinná tečka, ne čárka.
|
||||
|
||||
> Tip: 3,14 by C# přečetl jako dva údaje oddělené čárkou.
|
||||
|
||||
## Text a ano/ne
|
||||
*string, char, bool*
|
||||
|
||||
- string je text v uvozovkách.
|
||||
- char je jeden znak v apostrofech: 'A'.
|
||||
- bool je jen true nebo false.
|
||||
|
||||
> Tip: Apostrof a uvozovky nejsou totéž. 'A' je znak, "A" je text.
|
||||
|
||||
# Kód
|
||||
|
||||
```
|
||||
int cele = 42;
|
||||
double desetinne = 3.14;
|
||||
bool prsi = false;
|
||||
char pismeno = 'A';
|
||||
string text = "ahoj";
|
||||
Console.WriteLine(cele);
|
||||
Console.WriteLine(desetinne);
|
||||
Console.WriteLine(prsi);
|
||||
Console.WriteLine(pismeno);
|
||||
Console.WriteLine(text);
|
||||
```
|
||||
Loading…
Add table
Add a link
Reference in a new issue