Submit Search
Upload
プロエン4回
•
Download as PPTX, PDF
•
1 like
•
236 views
E
evesanta1224
Follow
プログラミング演習ヒント的な?
Read less
Read more
Software
Slideshow view
Report
Share
Slideshow view
Report
Share
1 of 18
Download now
Recommended
Case Study MPGtech 2011
Case Study MPGtech 2011
Prensa y Comunicación
Muscular dystrophy
Muscular dystrophy
alexbball3
Muscular dystrophy presentation
Muscular dystrophy presentation
kkbauer
めんどくさい…から始める効率化のススメ
めんどくさい…から始める効率化のススメ
Chikako Mori
YAPC::Hokkaido 2016 「普段使い言語環境」更新によるスキルリセットサバイバルガイド
YAPC::Hokkaido 2016 「普段使い言語環境」更新によるスキルリセットサバイバルガイド
keroyonn
議論を描く技術「ファシリテーショングラフィック」
議論を描く技術「ファシリテーショングラフィック」
nishikawa_makoto7
非同期系統の基礎
非同期系統の基礎
segayuu
PHP with Visual Studio
PHP with Visual Studio
Keiichi Kobayashi
Recommended
Case Study MPGtech 2011
Case Study MPGtech 2011
Prensa y Comunicación
Muscular dystrophy
Muscular dystrophy
alexbball3
Muscular dystrophy presentation
Muscular dystrophy presentation
kkbauer
めんどくさい…から始める効率化のススメ
めんどくさい…から始める効率化のススメ
Chikako Mori
YAPC::Hokkaido 2016 「普段使い言語環境」更新によるスキルリセットサバイバルガイド
YAPC::Hokkaido 2016 「普段使い言語環境」更新によるスキルリセットサバイバルガイド
keroyonn
議論を描く技術「ファシリテーショングラフィック」
議論を描く技術「ファシリテーショングラフィック」
nishikawa_makoto7
非同期系統の基礎
非同期系統の基礎
segayuu
PHP with Visual Studio
PHP with Visual Studio
Keiichi Kobayashi
2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot
Marius Sescu
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPT
Expeed Software
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage Engineerings
Pixeldarts
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
ThinkNow
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
marketingartwork
Skeleton Culture Code
Skeleton Culture Code
Skeleton Technologies
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
Neil Kimberley
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
contently
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
Albert Qian
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
Kurio // The Social Media Age(ncy)
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
Search Engine Journal
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
SpeakerHub
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
Clark Boyd
Getting into the tech field. what next
Getting into the tech field. what next
Tessa Mero
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Lily Ray
How to have difficult conversations
How to have difficult conversations
Rajiv Jayarajah, MAppComm, ACC
Introduction to Data Science
Introduction to Data Science
Christy Abraham Joy
Time Management & Productivity - Best Practices
Time Management & Productivity - Best Practices
Vit Horky
The six step guide to practical project management
The six step guide to practical project management
MindGenius
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
RachelPearson36
More Related Content
Featured
2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot
Marius Sescu
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPT
Expeed Software
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage Engineerings
Pixeldarts
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
ThinkNow
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
marketingartwork
Skeleton Culture Code
Skeleton Culture Code
Skeleton Technologies
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
Neil Kimberley
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
contently
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
Albert Qian
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
Kurio // The Social Media Age(ncy)
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
Search Engine Journal
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
SpeakerHub
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
Clark Boyd
Getting into the tech field. what next
Getting into the tech field. what next
Tessa Mero
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Lily Ray
How to have difficult conversations
How to have difficult conversations
Rajiv Jayarajah, MAppComm, ACC
Introduction to Data Science
Introduction to Data Science
Christy Abraham Joy
Time Management & Productivity - Best Practices
Time Management & Productivity - Best Practices
Vit Horky
The six step guide to practical project management
The six step guide to practical project management
MindGenius
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
RachelPearson36
Featured
(20)
2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPT
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage Engineerings
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
Skeleton Culture Code
Skeleton Culture Code
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
Getting into the tech field. what next
Getting into the tech field. what next
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
How to have difficult conversations
How to have difficult conversations
Introduction to Data Science
Introduction to Data Science
Time Management & Productivity - Best Practices
Time Management & Productivity - Best Practices
The six step guide to practical project management
The six step guide to practical project management
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
プロエン4回
1.
プログラミング演習 4回目
2.
はじめに • 4−1から4−5までは4th.pdfを見ながらやればす ぐにできるはず! • 頑張ってください!
3.
4−6概要 • 割り算をし、商と余りをメイン関数に返すユーザー 定義関数を作る • メイン関数で受け取った答えを画面に出力する
4.
4−6考察 • c言語ではユーザー定義関数からの返り値は1つし か戻せません。 • なので2つ以上戻すには工夫が必要 •
2つ以上のものを、まとめて管理できるものがあれ ばこの問題は解決できるはず! • そのまとめて管理できるものとは?=>配列!!
5.
でもしかし!! • 問題には関数は1つしか使ってはならないと書いて ありません • なので関数を二つ作ってそれぞれで計算させるのが 簡単!ですね! •
でもc言語の仕組みについて知りたい人は次のやり 方をやってみてください。
6.
4−6ヒント • 配列で商と余りの二つを管理する。よって要素数は 2個の配列をユーザー定義関数内で宣言する • int
hairetsu[2];を宣言するとかね? • そして計算をして商と余りを配列に格納する • その配列の先頭のアドレスをメイン関数に返すよう にする。先頭のアドレスとは上の例で言うと ”hairetu”ですね!
7.
4−6ヒント • return hairetu; •
↑これをするには関数の変数型はint*にしなければい けません。(int* 関数名……{ })こんな感じかな? • メイン関数で受け取ったポインタ変数を「pt」とす ると、*ptは配列の1つ目の値が取れる!*(pt + 1)は 配列の2つ目の値が読み取れる! • 受け取った二つを出力すればいいね
8.
4-A1
9.
4-1概要 • 4−6のユーザー定義関数を利用して10進数から n進数に変換するプログラムを作る このユーザ定義関数のプロト タイプは int* calc(int
hizyosu,int zyosu) こんな感じのはず!(笑)
10.
4−A1:最初に • 一番最初の値をnで割った余りが最下位ビットになることが わかる
11.
4−A1考察 • 一番最初の値をnで割った余りが最下位ビットになることが わかる • 例えばn=2の時 91 45…1 2 最下位ビ ット
12.
4−A1考察 • 一番最初の値をnで割った余りが最下位ビットになることが わかる • 例えばn=2の時 •
続けていくと 91 45…1 2 最下位ビ ット 2 22…1 次のビッ ト
13.
4−A1考察 • 一番最初の値をnで割った余りが最下位ビットになることが わかる • 例えばn=2の時 •
続けていくと • 最下位ビットから順番に変換 • した値がでてくる 91 45…1 2 最下位ビ ット 2 22…1 次のビッ ト・ ・ ・
14.
4−A1 • しかし、表示する順番は最上位ビットからなのでこ れではおかしくなってしまいます。 • この出てきた答えを順番に配列に格納します。 •
この時に格納した回数を数えておくと次に便利です • 出力するときは、格納した逆の順番から表示するよ うにします。(forなどで)
15.
4-A2
16.
4-A2概要 • 4−A2のプログラムを16進数まで対応するよう にせよ。
17.
4−A1 • 先ほどのプログラムでは数字しか表示できませんで した。 • でも今回はアルファベットも表示しなければいけま せん。 •
10はA、12はC、のように結びつけれるものが あればいいのになぁ
18.
4−A2 • 10番目はAと結びつけるのに簡単な方法はやっぱ り配列を使うことです。 • 配列宣言時で
“0123456789ABCDEF”を格納した 配列を宣言すると…ß • 配列[要素番号]で16進数まで対応することができ ました。
Download now