Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
Программирование на ЯВУ, семинар 2
Search
Ilya
September 08, 2015
Education
75
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Программирование на ЯВУ, семинар 2
Ilya
September 08, 2015
More Decks by Ilya
See All by Ilya
Программирование на ЯВУ, семинар 3
ilya
0
170
ОПК, семинар №8
ilya
0
58
ОПК, семинар №6
ilya
0
79
ОПК, семинар №4
ilya
0
110
ОПК, семинар №2
ilya
0
93
Other Decks in Education
See All in Education
吉岡研究室紹介(2026年度)
kentaroy47
0
380
Sekolah Sabat - Triwulan 3 2026 - Pelajaran 13
hiola
0
11k
ちいかわを読め
uchi8977
1
410
新型コロナ禍をともに「楽しみながら開いていこう!」 :中門 吉松 会員(2720 Japan O.K.ロータリーEクラブ)卓話 : 2026.10.19.例会・卓話
2720japanoke
0
350
INTRODUCTION TO THE CELL
pawan_pharm
0
330
【ainiチャット操作ガイド】
ainischool
0
130
形骸化しない社内勉強会の取り組み - オーナーシップの作り方 / In-house study session
soudai
PRO
1
430
生成AIとの付き合い方/ How to work with AI
kaityo256
PRO
3
890
批判的応用言語学ワークショップ(2026-08-12 お茶の⽔⼥⼦⼤学)
terasawat
0
210
2026年度秋学期 統計学 講義の進め方と成績評価について (2026. 9. 28)
akiraasano
PRO
0
250
1002
cbtlibrary
0
360
子どものためのプログラミング道場『CoderDojo』〜法人提携例〜 / Partnership with CoderDojo Japan
coderdojojapan
PRO
4
19k
Featured
See All Featured
Leveraging LLMs for student feedback in introductory data science courses - posit::conf(2025)
minecr
1
440
Information Architects: The Missing Link in Design Systems
soysaucechin
1
1.2k
The World Runs on Bad Software
bkeepers
PRO
72
12k
Building a A Zero-Code AI SEO Workflow
portentint
PRO
0
790
Typedesign – Prime Four
hannesfritz
42
3.2k
SERP Conf. Vienna - Web Accessibility: Optimizing for Inclusivity and SEO
sarafernandez
2
1.6k
How to Grow Your eCommerce with AI & Automation
katarinadahlin
PRO
2
330
Money Talks: Using Revenue to Get Sh*t Done
nikkihalliwell
0
520
Six Lessons from altMBA
skipperchong
29
4.5k
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
31
2.9k
ReactJS: Keep Simple. Everything can be a component!
pedronauck
666
130k
My Coaching Mixtape
mlcsv
0
360
Transcript
http://en.cppreference.com/w/c http://learnxinyminutes.com/docs/c/ https://en.wikibooks.org/wiki/C_Programming http://c.learncodethehardway.org/book/ Kernigan and Ritchie: The C Programming
Language (K&R) Полезное про C
http://immersivemath.com/ila/index.html http://visualgo.net/ Полезное
void swap(double arr[]) { double x; x = arr[0]; arr[0]
= arr[1]; arr[1] = x; } void main() { double arr[2]; arr[0] = 1.0; arr[1] = 2.0; swap(arr); printf("%f %f\n", arr[0], arr[1]); } > 2.000000 1.000000 Массивы и функции
Нужно больше stdlib.h #include <math.h> printf("%f %2.f %.2f\n", M_PI, M_PI,
M_PI); > 3.141593 3 3.14 printf("%e %2.e %.2e\n", M_PI, M_PI, M_PI); > 3.141593e+00 3e+00 3.14e+00
#include <stdio.h> #include <stdlib.h> void main() { int i, number;
for(i = 0; i < 5; i++) { number = rand() % 100; printf("%d: %d\n", i, number); } } > 0: 83 > 1: 86 > 2: 77 > 3: 15 > 4: 93 Случайные числа
assert.h int factorial(int n) { // вырезано цензурой } void
main() { int i, result; for(i = 1; i < 6; i++) { result = factorial(i); printf("%d! = %d\n", i, result); } } > 1! = 1 > 2! = 2 > 3! = 6 > 4! = 24 > 5! = 120
printf("%d! = %d\n", -5, factorial(-5)); Segmentation fault (core dumped)
int factorial(int n) { assert(n >= 0); // вырезано цензурой
} printf("%d! = %d\n", -5, factorial(-5)); main: main.c:5: factorial: Assertion `n >= 0' failed. Aborted (core dumped)
Тестирование int celsius_to_fahrenheit(int c) { // } int fahrenheit_to_celsius(int f)
{ // } void main() { printf("%d\n", celsius_to_fahrenheit(30)); // 86 assert(celsius_to_fahrenheit(30) == 86); assert(fahrenheit_to_celsius(86) == 30); assert(celsius_to_fahrenheit(0) == 32); assert(fahrenheit_to_celsius(32) == 0); }
Стиль // Вычисление 2*X^2 + 3*X — 5 для X
int some_fun(int i) { int j=2,k,l=3,m,n=-5; if(i!=0) return j*i*i+l*i+n; else {printf("invalid x %d",i);} return -5; }
int polynomial(int x) { int a = 2, b =
3, c = -5; if(x == 0) { printf("Not a very interesting x\n"); return c; } else { return a * pow(x, 2) + b * pow(x, 1) + c; } }
Константы int i; int a[7]; // Ещё хуже, когда a[5]
for(i = 0; i < 6; i++) { a[i] = pow(10, i); printf("%d ", a[i]); } // Совсем плохо, когда так: for(i = 0; i < 6; i++) { ... for(i = 0; i < 6; i++) { ... for(i = 0; i < 6; i++) { ... for(i = 0; i < 6; i++) { ... for(i = 0; i < 6; i++) {
const unsigned size = 6; void main() { int i;
int a[size]; for(i = 0; i < size; i++) { a[i] = pow(10, i); printf("%d ", a[i]); } }