你好!今天,我写信告诉你我去青岛之行的所见所闻,和你一起分享快乐。
这一天,妈妈带我去青岛旅游。一路上,导游给我们讲解了,青岛是个美景如画的著名的旅游城市。是个海滨之城。青岛有纪念五四运动导火索而成名的五四广场,有国内著名的避暑,疗养小区,八大关,还有好玩的极地海洋世界和著名的国际啤酒节。
我们到了青岛以后,导游首先带我们去了五四广场,接着去了海底世界:那里有白鲨、海豚、海狮、刺豚、地图鱼······真是应有尽有。那儿的地图鱼很奇特,它的背部凹凸不平,像祖国的地形很可爱。还有刺豚,也很奇特,它的脸又大又圆,嘴巴也很大,浑身长满了刺······还去了韩国城,最后去了礁石海滩,在那儿我玩得最开心了,我本来在那儿拾贝壳,忽然一个小伙伴叫道:“快看这儿有许多螃蟹。”我跑近一看,真的有许多螃蟹。我从妈妈包里拿出一根铁丝做成了钩,伸进去掏螃蟹。里面的螃蟹好像发觉我在勾它,就一个劲儿地往里爬。当我勾住它的一只脚时,它只好束手就擒,我就用手“活捉”了它。正在我得意之时,它以迅雷不及掩耳之势夹住了我的一根手指,我就拼命地甩,终于把这小家伙摆脱了······上岸时,我捉了满满一袋子战利品呢!我的\'心里好不得意。
第二天,我们早早的起床了,我们去了烟台威海,那儿真是“海的圣地”“海的世界”呀!那儿的水清澈见底,正适合游泳,可今天刚下过雨,大家都不敢下水游泳。我和妈妈也只好像满沙滩赶海的游人一样捞着裤脚戏水、拍照。
突然妈妈说道:“董旭!董旭!快来看,这是什么呀!”我仔细一看,水里有许多白花花、亮晶晶而且特别粘手的小东西。一开始我以为是一朵花,那嘴巴像一个小圆球,身体像有许多花瓣组成的小东西。我想抓一只带回家玩玩,可这时妈妈说道:“这是水母,是海洋的宝宝,它离开了大海,就无法生存下去了。”于是我把它放回了大海。
接着,我就在软软的松松的沙滩上奔跑、玩水、嬉戏。我望着一望无际的大海,正是令人心旷神怡啊!
祝你学习进步!
你的同学:董旭
听说你们那儿的圣诞节快到了,我知道你们的圣诞节就和我们的春节一样热闹,你一定高兴极了吧!祝你们全家节日快乐,也衷心的盼望你到中国来玩,到我家来做客!
Yesterday I saw the school first class, feeling very deep. This year's theme is beauty is near. Beauty, a very common words, we are literally think beauty is beautiful. So, what is the true meaning of beauty?
With the question I look up, the first lesson is to find beauty. How to find? It makes people lost in thought. When everybody zhang two monks confused, host "shenzhou" 9 astronaut liu Yang, please tell for you. Liu said, the universe is endless, much bigger than she had expected: long, on the other side of the galaxy, the star vega, mercury, Saturn... . All panoramic view. Time is the most interesting of weightlessness, everyone one by one all floating in the air, pens, book ah of what are messy, can be fun. Finally, she concludes the essence to find beauty, love sports, and more to find the beauty around, so beauty will show in front of you.
LiuLiLi mountain elementary school teachers as the second class of the bell took to the podium, she is only 20 years old this year, in this flower age, many girls are enjoying, who will suffer poor mountainous areas! Can't liu, she is out of the mountain, liu with great love for the children's happiness, she hold the children art, gymnastics and other mountainous area children can't learn knowledge. Liu planted beauty, transfer the beauty. Let the beauty of the mountains germination, results. So she right because when people called the most beautiful teacher, this is to create beautiful?
Gymnastics team player Chen yibing showed also in the field. His contribution for our country in the London Olympic Games, the host asked him why he is going to win? His answer: before the race, they are seen as a failure. But because of his companions support each other, encourage each other. Make them very first champions league. The companion's encouragement is beauty.
Yu Dan is the most let me have a feeling of the teacher's words. She hit a harmonious beauty, for example, put eggs, tea, carrot in boiling water, eggs, hardened into the fragrant tea, tea radish was soft. That means what? Hardened eggs tend to be the kind of person who are "really low on agreeableness, and most men are single minded and turnip are too weak, they couldn't get hold of degree dating, so don't be understood, so being bullied. And the tea? It combines with water, this kind of person is good at unity collective, so they are best represents the harmonious beauty.
The school first class with only an hour and a half, but let me benefit a lot.
C语言while、do-while、for循环课程5
课程3中,提到C语言基本语句分为:数据定义语句,数据处理语句
数据处理语句又可分为:表达式语句,函数调用语句,空语句(;,复合语句,流程控制语句。
流程控制:指程序代码执行的顺序。流程的分类:顺序、选择、循环。
C语言的循环结构通过三种语句来实现,即while、do-while、forWhile语句的一般形式while(循环条件表达式循环体语句;
功能:当循环条件表达式为真,执行循环体语句,执行完了,再判断条件表达式是否为真,为真,则再执行,直到条件表达式为假时,退出while循环。
实例1:用while语句求1~100的累加和。
#include//C语言编译预处理命令,文件包含为stdio.h
voidmain(//至少有一个用main(命名的主函数,返回值为void无值类型{
inti=1,sum=0;/*初始化循环,定义变量i和累加器sum,定义和之前,累加器清零*/
while(i<=100
{
sum+=i;//sum+=i是一个复合赋值运算符,等价于sun=sun+i;i++;
}
printf("1+2+3+...+100=%d ",sum;//输出十进制数,1加到100累加器的和}
MicrosoftVisualC++6.0运行结果
使用while循环时,一定要对循环条件表达式中出现的变量提前赋值,并在循环体内修改有关变量的值,以使循环能趋于终止。
While循环为当型循环,do-while循环也叫直到型循环。
do-while语句的一般形式为:
do
{
循环体语句}while(
循环条件表达式
实例2:用do-while编制一个求n!的程序,n的值由键盘输入。
#include
voidmain(
{inti=1,n,p=1;
printf("请从键盘输入一个数,进行连乘积: ";
scanf("%d",&n;
do
{p=p*i;
i++;
}while(i<=n;
printf("连乘积的结果为p=n!:%d ",p;
}
分析:此程序,先定义三个变量i、n、p,p从p乘1开始执行,再i进行自增1,循环体中的语句执行完毕后,判断while的循环条件表达式,当i自增1为2时,看2是否<=输入的n值,若为真,则继续返回do循环,直到i自增的值比n大,则退出循环。
do-while主要用于人机交互,do-while循环是先执行后判断,do里面的循环体至少被执行一次。区别于while是先判断循环条件表达式,后执行。
for循环也叫步长型循环
一般格式:for(表达式1;表达式2;表达式3循环体语句;
功能:先执行表达式1,再执行表达式2,如果表达式2的值为真,就执行循环体语句,最后执行表达式3.完成一次循环后,从表达式2执行,直到表达式2为假,退出循环。
实例3:参考实例1,用while求1~100的累加和,现在用for语句求1~100的累
加和。
#include
intmain(void
{
inti;intsum=0;
/*初始化循环,定义变量i
和累加器sum,定义和之前,累加器清零*/
for(i=1;i<=100;i++
{
sum=sum+i;
}
printf("sum=%d ",sum;
return0;
}
实例4:爱因斯坦的`阶梯问题:有一个长阶梯,若每步上2阶,最后剩1阶;若每步上3阶,最后剩2阶;若每步上5阶,最后剩4阶;若每步上6阶,最后剩5阶;只有每步上7阶,最后刚好一阶也不剩。请问该阶梯至少有多少阶。编写一个C程序解决该问题。
#include
main(
{intx;
for(x=7;;x+=7
if(x%3==2&&x%5==4&&x%6==5
break;
printf("Thenumberoftheladdersis:%d ",x;
}
分析:发现x一定是7的整数倍,可以依次递增地求出7的整数倍的值(7*1、7*2、7*3……),每求出一值,就用该值与2、3、5、6进行取模运算,最先得到的满足上述5个方程式的x值即为本题的答案。
用while语句,简单快速实现爱因斯坦的阶梯问题
#include
intmain(
{
inti=1;/*i为所设的阶梯数*/
while(!((i%2==1&&(i%3==2&&(i%5==4&&(i%6==5&&(i%7==0
++i;/*满足一组同余式的判别*/
你的自我介绍我看见了。我也是一名二年级是学生,我是浙江温州人,我爸爸是在昆明做生意,现在居住在昆明世纪城茗春苑。我家有四口人,我和姐姐、爸爸、妈妈,我爸爸忙着生意整天不在家,妈妈负责我和姐姐生活和学习,也照顾得很好。我和姐姐在一个学校读书,她上初中一年级,学习很好,姐姐也是我最好的伙伴。平时我和姐姐也爱玩电脑,不过要做完作业才能玩一下,妈妈总说玩电脑对眼睛不好,希望你也要注意呀!
圣诞节快要到了,一定很热闹吧。是不是像我们中国人过年一样热闹呀!我祝你全家圣诞节快乐。我很想和你做朋友,好吗?以后我教你说中文,你教我说英文。
祝你学习进步!
© 2022 xuexicn.net,All Rights Reserved.