7.จงเขียนโปรแกรมเพื่อรับค่าตัวเลข 1 จำนวน เพื่อตรวจสอบว่าเป็นเลขคู่(Even number) หรือว่าเป็นเลขคี่(Odd Number)จากนั้นใช้ขึ้นข้อความว่า Do you want to continue('Y/N')? เพื่อถามว่าต้องการจะรับค่าตัวเลขตัวถัดไปหรือไม่ ถ้าผู้ใช้กดปุ่ม Y จะให้มีการรับค่าตัวเลขตัวถัดไป ถ้าผู้ใช้กดปุ่ม N โปรแกรมจะจบการทำงาน
#include<stdio.h>
#include<conio.h>
main()
{
int i,a,b,d ;
char Out='Y';
do
{
printf("Enter Number : ");
scanf("%d",&a);
if (a%2==0)
{
printf("%d is even number\n",a);
}
else if (a%2!=0)
{
printf("%d is odd number\n",a);
}
printf("Do you want to continue(Y/N):" );
//scanf("%c",&Out);
Out=getche();
printf("\n");
}
while(Out=='Y');
getch();
}
2554-07-18
2554-07-11
ข้อที่8
ข้อที่8 จงเขียนโปรแกรมเพื่อรับน้ำหนักของเพื่อน 5 คน โดยใช้คำสั่ง for แล้วหาค่าน้ำหนักรวม
#include<stdio.h>
#include<conio.h>
main()
{
int i,a,sum;
printf("Input\n");
sum=0;
for(i=1; i<=5; i++ )
{
printf("Enter weight : ");
scanf("%d",&a);
sum=sum+a;
}
printf("Output\n");
printf("summary = %d",sum);
getch();
}
#include<stdio.h>
#include<conio.h>
main()
{
int i,a,sum;
printf("Input\n");
sum=0;
for(i=1; i<=5; i++ )
{
printf("Enter weight : ");
scanf("%d",&a);
sum=sum+a;
}
printf("Output\n");
printf("summary = %d",sum);
getch();
}
ข้อที่9
ข้อที่9 จงเขียนโปรแกรมหาผลบวกจาก 1 ถึงตัวเลขที่เราป้อนค่า
#include<stdio.h>
#include<conio.h>
main()
{
int i,a,sum;
printf("Put number : ");
scanf("%d",&a);
sum=0;
for(i=1; i<=a;i++)
{
sum=sum+i;
}
printf("summation=%d",sum);
getch();
}
#include<stdio.h>
#include<conio.h>
main()
{
int i,a,sum;
printf("Put number : ");
scanf("%d",&a);
sum=0;
for(i=1; i<=a;i++)
{
sum=sum+i;
}
printf("summation=%d",sum);
getch();
}
ข้อที่10
ข้อที่10 จงเขียนโปรแกรมเป็นรูปสี่เหลี่ยม โดยใช้ตัวอักษร A ขนาดเท่ากับจำนวนตัวเลขแถว (row) และหลัก ( column) ที่รับเข้ามา
#include<stdio.h>
#include<conio.h>
main()
{
int i1,i2,a,b,c,e;
printf("Put row : ");
scanf("%d",&a);
printf("Put col : ");
scanf("%d",&c);
for(i1=1; i1<=a; i1++)
{
{
printf("A",a);
}
for(i2=1; i2<c; i2++)
{
printf("A",c);
}
b=(a*c)/a;
if(b==c)
{
printf("\n");
}
}
getch();
}
#include<stdio.h>
#include<conio.h>
main()
{
int i1,i2,a,b,c,e;
printf("Put row : ");
scanf("%d",&a);
printf("Put col : ");
scanf("%d",&c);
for(i1=1; i1<=a; i1++)
{
{
printf("A",a);
}
for(i2=1; i2<c; i2++)
{
printf("A",c);
}
b=(a*c)/a;
if(b==c)
{
printf("\n");
}
}
getch();
}
ข้อที่11
ข้อที่11 จงเขียนโปรแกรมเพื่อรับตัวอักขระและตัวเลขเฉพาะ 4-9 เพื่อแสดงผลตัวอักขระเป็นรูปสี่เหลี่ยมขนาดเท่ากับจำนวนตัวเลขที่รับเข้ามา ถ้าอยู่นอกช่วง 4-9 จะไม่แสดงผล
#include<stdio.h>
#include<conio.h>
main()
{
char x;
int n,i;
printf("Put alphabet : ");
scanf("%c",&x);
printf("Put Number : ");
scanf("%d",&n);
switch(n)
{
case 4:case 5:case 6:case 7:case 8:case 9:
for(i=1;i<=n*n;i++)
{
printf("%c",x);
if(i%n==0)
printf("\n");
}
}
getch();
}
#include<stdio.h>
#include<conio.h>
main()
{
char x;
int n,i;
printf("Put alphabet : ");
scanf("%c",&x);
printf("Put Number : ");
scanf("%d",&n);
switch(n)
{
case 4:case 5:case 6:case 7:case 8:case 9:
for(i=1;i<=n*n;i++)
{
printf("%c",x);
if(i%n==0)
printf("\n");
}
}
getch();
}
2554-07-10
Vocabulary from Music
เพลง My Happy Ending - Avril Lavigne
(Oh, oh, oh, oh)
Let's talk this over
You were all the things I thought I knew
You were everything, everything
Just fade away
You've got your dumb friends
Do they even know you?
You were all the things I thought I knew
You were everything, everything
All of the memories so close to me
It's nice to know that you were there
He was everything, everything
You were everything, everything
คำศัพท์ที่ได้จากเนื้อเพลง
glitz หมายถึง [N] ความดึงดูดใจ; ความฉูดฉาด
[Verse 1 - Eminem]
High off on love, drunk from my hate
Here we go again, it's so insane
[Chorus - Rihanna]
[Verse 2 - Eminem]
Mr .(?). is the culprit ..(?)..
[Chorus - Rihanna]
[Verse 3 - Eminem]
Baby please come back, it wasn't you. Baby it was me.
http://my.dek-d.com/mu_mu_jung/blog/?blog_id=10109343
คำศัพท์ที่ได้จากเนื้อเพลง
windpipe หมายถึง [N] หลอดลม
EX]] Windpipe is the tube in your body that carries air into your lungs from your nose or mouth
suffocate หมายถึง [VI] หายใจไม่ออก S.asphyxiate; choke; smother
[VT] ขัดขวาง; สกัดกั้น, ยับยั้ง S.confine; restrict
[VT] ฆ่าโดยการทำให้หายใจไม่ออก
[VT] ทำให้ร้อนอบอ้าว; ร้อนอบอ้าว, ร้อนระอุ S.swelter
[VT] ทำให้อึดอัดหายใจไม่ออก; ทำให้หายใจไม่ออก S.asphyxiate; choke; smother
EX]] Many of the victims either burnt to death or suffocated.
resuscitates หมายถึง [VT] ช่วยให้ฟื้นคืนสติ; ช่วยให้รอดชีวิต S.revive; save
Ex]] The government’s efforts to resuscitate the economy
chills หมายถึง [N]ความหนาว,ความเยือกเย็น,ความหมดสนุก,ความเฉยเมย
[Adj] หนาว,หนาวสะท้าน,เฉยเมย,ซึ่งทำให้หมดกำลังใจ.
[V] เปลี่ยนเป็นหนาวเย็น,ทำให้หนาวสั่น,ทำให้หมดกำลังใจ,ทำให้หวาดกลัว,แช่เย็น
Ex]] The icy winds had chilled us to the bone.
spewing หมายถึง [V] คาย,อาเจียน,พ่น,สำรอก,ทิ้งขว้าง
Ex]] Cars spewing black exhaust fumes
restraint หมายถึง [N] การหน่วงเหนี่ยว; การควบคุม, การหักห้ามใจ, การข่มอารมณ์ S.moderation; temperance; self-denial A.slackness; laxity
EX]]The President sent a letter to both nations urging restraint.
(Oh, oh, oh, oh)
So much for my happy ending
(Oh, oh, oh, oh)
(Oh, oh, oh, oh)
So much for my happy ending
(Oh, oh, oh, oh)
(Oh, oh, oh, oh)
(Oh, oh)
Let's talk this over
It's not like we're dead
Was it something I did?
Was it something you said?
Don't leave me hanging
In a city so dead.
Held up so high
On such a breakable thread
You were all the things I thought I knew
And I thought we could be
You were everything, everything
That I wanted
We were meant to be, supposed to be
But we lost it
All of the memories so close to me
Just fade away
All this time you were pretending
So much for my happy ending
(Oh, oh, oh, oh)
So much for my happy ending
(Oh, oh, oh, oh)
(Oh, oh, oh, oh)
You've got your dumb friends
I know what they say
They tell you I'm difficult
But so are they
But they don't know me
Do they even know you?
All the things you hide from me
All the shit that you do
You were all the things I thought I knew
And I thought we could be
You were everything, everything
That I wanted
We were meant to be, supposed to be
But we lost it
All of the memories so close to me
Just fade away
All this time you were pretending
So much for my happy ending
It's nice to know that you were there
Thanks for acting like you care
And making me feel like I was the only one
It's nice to know we had it all
Thanks for watching as I fall
And letting me know we were done
He was everything, everything
That I wanted
We were meant to be, supposed to be
But we lost it
All of the memories so close to me
Just fade away
All this time you were pretending
So much for my happy ending
You were everything, everything
That I wanted
We were meant to be, supposed to be
But we lost it
All of the memories so close to me
Just fade away
All this time you were pretending
So much for my happy ending
(Oh, oh, oh, oh)
So much for my happy ending
(Oh, oh, oh, oh)
(Oh, oh, oh, oh)
So much for my happy ending
(Oh, oh, oh, oh)
(Oh, oh, oh, oh)
(Oh, oh, oh, oh)
credit : www.metrolyrics.com
fade away หมายถึง [PHRV] ค่อยๆ จางหายไป; ค่อยเลือนหายไป
EX]] Her footsteps faded away down the staircase.
pretend หมายถึง [V]แสร้งทำ,เสแสร้ง,หลอกลวง,อวดอ้าง,อ้างสิทธิ.
EX]] It was useless to pretend innocence.
Tread หมายถึง [n]ด้าย; เส้นด้าย, เส้นไหม, เส้นใย
EX]] On such a breakable thread
[v] เคลื่อนที่ไปอย่างระมัดระวัง
EX]]Investors should tread carefully until new interest rates are announced.
เพลง Airplanes Ft Hayley Williams & Eminem
[Hayley Williams]
Can we pretend that airplanes
In the night sky
Are like shooting stars
I could really use a wish right now (wish right now) (wish right now)
Can we pretend that airplanes
In the night sky
Are like shooting stars
I could really use a wish right now (wish right now) (wish right now)
[B.o.B]
Yeah
I could use a dream or a genie or a wish
To go back to a place much simpler than this
Cause after all the partyin and smashin and crashin
And all the glitz and the glam and the fashion
And all the pandemonium and all the madness
There comes a time where you fade to the blackness
And when youre staring at that phone in your lap
And you hoping but them people never call you back
But thats just how the story unfolds
You get another hand soon after you fold
And when your plans unravel
And they sayin what would you wish for
If you had one chance
So airplane airplane sorry Im late
Im on my way so dont close that gate
If I dont make that then Ill switch my flight
And Ill be right back at it by the end of the night
[Chorus Hayley Williams]
Can we pretend that airplanes
In the night sky
Are like shooting stars
I could really use a wish right now (wish right now) (wish right now)
Can we pretend that airplanes
In the night sky
Are like shooting stars
I could really use a wish right now (wish right now) (wish right now)
[B.o.B]
Somebody take me back to the days
Before this was a job, before I got paid
Before it ever mattered what I had in my bank
Yeah back when I was tryin to get into the subway
And back when I was rappin for the hell of it
But now a days we rappin to stay relevant
Im guessin that if we can make some wishes outta airplanes
Then maybe yo maybe Ill go back to the days
Before the politics that we call the rap game
And back when aint nobody listened to my mix tape
And back before I tried to cover up my slang
But this is for the Cada, whats up Bobby Ray
So can I get a wish to end the politics
And get back to the music that started this shit
So here I stand and then again I say
Im hopin we can make some wishes outta airplanes?
[Chorus Hayley Williams]
Can we pretend that airplanes
In the night sky
Are like shooting stars
I could really use a wish right now (wish right now) (wish right now)
Can we pretend that airplanes
In the night sky
Are like shooting stars
I could really use a wish right now (wish right now) (wish right now)
credit :http://yuiloves.blogspot.com/2010/06/airplanes-feat-hayley-williams-of.html
คำศัพท์ที่ได้จากเนื้อเพลง
EX]] My glitz is a movie that Robert Pattison acts.
pandemonium หมายถึง [N] ความโกลาหล; ความสับสนวุ่นวาย
EX]] I hate sometime when my life is pendemonium.
smash in หมายถึง [PHRV] พังเข้าไป; กระแทกเข้าไป
EX]] The front of the car was all smashed in.
unravel หมายถึง [V] คลี่คลาย,แก้,ปลดปล่อย
EX]] Police are trying to unravel the mystery of their sudden disappearance.
relevant หมายถึง [ADJ] สำคัญ; มีความหมาย S.essential; significant
[ADJ] เข้าประเด็น; ซึ่งเกี่ยวเนื่องกัน, ตรงประเด็น, ซึ่งสัมพันธ์กัน S.pertinent
EX]]Once we have all the relevant information, we can make a decision.
เพลง Love The Way You Lie - Eminem Feat Rihanna
[Chorus - Rihanna]
Just gonna stand there and watch me burn
Well that's alright because I like the way it hurts
Just gonna stand there and hear me cry
Well that's alright because I love the way you lie
Love the way you lie
I can't tell you what it really is
I can only tell you what it feels like
And right now there's a steel knife in my windpipe
I can't breathe but I still fight all I can fight
As long as the wrong feels right it's like I'm in flight
It's like I'm huffin' paint and I love it
The more I suffer, I suffocate
Right before I'm about to drown, she resuscitates
Me, she fuckin' hates me, and I love it, Wait!
Where you going? I'm leaving you.
No you ain't. Come back. We're running right back
Cuz when it's going good, it's going great
I'm Superman with the wind in his back
She's Lois Lane
and when it's bad, it's awful
I feel so ashamed, I snap "Who's that dude?"
I don't even know his name
I laid hands on him, I never stood so low again
I guess I don't know my own strength
Just gonna stand there and watch me burn
Well that's alright because I like the way it hurts
Just gonna stand there and hear me cry
Well that's alright because I love the way you lie
I love the way you lie
I love the way you lie
You ever love somebody so much,
you could barely breathe when you with 'em?
You meet, and neither one of you even know it hit 'em
Got that warm fuzzy feeling, yeah them chills you still get 'em
Now you gettin' fuckin' sick of lookin' at 'em
You swore you'd never hit 'em, never do nothing to hurt 'em
Now you're in each other's face spewing venom in your words when you spit 'em
You push, pull each other's hair, scratch, claw, bit 'em
Throw 'em down, pin 'em, so lost in the moments when you're with 'em
Shawty say, you'd best to go your separate ways
Guess that they don't know ya cuz today,
That was yesterday, yesterday is over and it's a different day
Sound like broken records playing over
But you promised her, next time you'd show restraint
You don't get another chance
Life is no Nintendo Game
but you lied again
Now you get to watch her leave out the window
Guess that's why they call it "window pane"
Just gonna stand there and watch me burn
Well that's alright because I like the way it hurts
Just gonna stand there and hear my cry
Well that's alright because I love the way you lie
I love the way you lie
I love the way you lie
Now I know we said things, did things that we didn't mean
And we fall back into the same patterns, same team
But your temper's just as bad as mine is
You're the same as me
When it comes to love you're just as blinded
Maybe our relationship isn't as crazy as it seems
Maybe that's what happens when a tornado meets a volcano
All I know is I love you too much, to walk away now
Come inside, pick up your bags off the sidewalk
Don't you hear sincerity in my voice when I talk?
I told you this is my fault, look me in the eyeball
Next time I'm pissed, I'll aim my fist at the drywall
Next time? There won't be no next time
I apologize, even though I know it's lies
I'm tired of the games, I just want her back. I know I'm a liar
If she ever tries to fuckin' leave again,
Ima tie her to the bed and set this house on fire
Just gonna
[Chorus - Rihanna]
Just gonna stand there and watch me burn
Well that's alright because I like the way it hurts
Just gonna stand there and hear my cry
Well that's alright because I love the way you lie
I love the way you lie
I love the way you lie
credit : http://www.elyricsworld.com
คำศัพท์ที่ได้จากเนื้อเพลง
windpipe หมายถึง [N] หลอดลม
EX]] Windpipe is the tube in your body that carries air into your lungs from your nose or mouth
suffocate หมายถึง [VI] หายใจไม่ออก S.asphyxiate; choke; smother
[VT] ขัดขวาง; สกัดกั้น, ยับยั้ง S.confine; restrict
[VT] ฆ่าโดยการทำให้หายใจไม่ออก
[VT] ทำให้ร้อนอบอ้าว; ร้อนอบอ้าว, ร้อนระอุ S.swelter
[VT] ทำให้อึดอัดหายใจไม่ออก; ทำให้หายใจไม่ออก S.asphyxiate; choke; smother
EX]] Many of the victims either burnt to death or suffocated.
The men tried to suffocate him with a plastic bag.
Ex]] The government’s efforts to resuscitate the economy
chills หมายถึง [N]ความหนาว,ความเยือกเย็น,ความหมดสนุก,ความเฉยเมย
[Adj] หนาว,หนาวสะท้าน,เฉยเมย,ซึ่งทำให้หมดกำลังใจ.
[V] เปลี่ยนเป็นหนาวเย็น,ทำให้หนาวสั่น,ทำให้หมดกำลังใจ,ทำให้หวาดกลัว,แช่เย็น
Ex]] The icy winds had chilled us to the bone.
spewing หมายถึง [V] คาย,อาเจียน,พ่น,สำรอก,ทิ้งขว้าง
Ex]] Cars spewing black exhaust fumes
restraint หมายถึง [N] การหน่วงเหนี่ยว; การควบคุม, การหักห้ามใจ, การข่มอารมณ์ S.moderation; temperance; self-denial A.slackness; laxity
EX]]The President sent a letter to both nations urging restraint.
สมัครสมาชิก:
บทความ (Atom)