网页资讯视频图片知道文库贴吧地图采购
进入贴吧全吧搜索

 
 
 
日一二三四五六
       
       
       
       
       
       

签到排名:今日本吧第个签到,

本吧因你更精彩,明天继续来努力!

本吧签到人数:0

一键签到
成为超级会员,使用一键签到
一键签到
本月漏签0次!
0
成为超级会员,赠送8张补签卡
如何使用?
点击日历上漏签日期,即可进行补签。
连续签到:天  累计签到:天
0
超级会员单次开通12个月以上,赠送连续签到卡3张
使用连续签到卡
05月19日漏签0天
niit吧 关注:527贴子:4,364
  • 看贴

  • 图片

  • 吧主推荐

  • 游戏

  • 7回复贴,共1页
<<返回niit吧
>0< 加载中...

niit-C# 第二章

  • 只看楼主
  • 收藏

  • 回复
  • 雨花抬老汉
  • 英雄豪杰
    10
该楼层疑似违规已被系统折叠 隐藏此楼查看此楼
具体不解释, C语言基础,只摘录点要熟记的英文


  • 雨花抬老汉
  • 英雄豪杰
    10
该楼层疑似违规已被系统折叠 隐藏此楼查看此楼
1. program often involve decision-making and iterative tasks.You can use conditional constructs for decision making and looping constructs for interative tasks in your programs.
2. Arithmetic assignment operators are used to perform arithmetic operations on two given operands and to assign the resultant value to any of them.
[+=、-=、*=、 /=、%= ]
3. dot operator is used to access the member of a class.


2025-05-19 07:58:59
广告
  • 雨花抬老汉
  • 英雄豪杰
    10
该楼层疑似违规已被系统折叠 隐藏此楼查看此楼
4. If the 'if' and 'else' part of the 'if...else' construct contains single statements,then there is no need to enclose the statements within curly braces.
if 和else 后面只包含一个语句,可以不用大括号
5. The ‘else‘ block in the if...else construct is optional and cam be omitted.
if...else结构的else块是可选的(随意的),可以被忽略。
6. The break statement is used to exit(退出) the switch statement.This prevents the execution of the remaining case structures by ending the execution of the seitch...case construct.
7. Each 'case' keyword is followed by a possible value for the variable.
8. switch...case结构只在开头evaluate an expression,而if...else 结构在每一个if语句后面evaluate the expression.


  • 雨花抬老汉
  • 英雄豪杰
    10
该楼层疑似违规已被系统折叠 隐藏此楼查看此楼
Activity:
Write a program that accept two primary colors from the user,adds them and displays the output in the new color combination.If the user enters an incorrect color,the program should display the warning。


  • 雨花抬老汉
  • 英雄豪杰
    10
该楼层疑似违规已被系统折叠 隐藏此楼查看此楼
Loop constructs
9.The while statements always checks the condition before executing the statements within the loop.
while语句总是在循环之前检查条件是不是符合情况(not after!!)
10. The statements within "do...while" loop are executed at least ince,as the statements in the block are executed before the condition is checked.
do...while语句至少执行一次,因为语句在被检查之前就已经执行
11. In the for loop,the initialization expression is executed only once at the beginning of the loop.
只被初始化一次,格式:for(initialization; termination; increment/decrement) {....}
12.break and continue statements
The break statements is used to exit from the loop
The continue statements is used to skip all the subsequent instructions and take the control back to the loop.
[break退出循环,continue跳过后续命令并且让循环继续运行]


  • 雨花抬老汉
  • 英雄豪杰
    10
该楼层疑似违规已被系统折叠 隐藏此楼查看此楼
Activity:Fibonacci series
in the range 1 to 200 will be : 1,1,2,3,5,8,13...,144.


  • 雨花抬老汉
  • 英雄豪杰
    10
该楼层疑似违规已被系统折叠 隐藏此楼查看此楼
第二章内容要掌握的就这么多,要把绕的地方再想想,比如自增自减,++i 和i++,break和continue熟练应用、开关语句的注意点,以及与break;配合使用


  • 雨花抬老汉
  • 英雄豪杰
    10
该楼层疑似违规已被系统折叠 隐藏此楼查看此楼
exercise1: Write a program to identify whether a character entered by a user is a vowel or a consonant.[识别用户输入的字符是元音还是辅音]
exercise2:Write a program to display the highest of any 10 numbers entered.
[显示输入的任何10个数的最高值]
exercise3:Enter a year and determine whether the year is a leap year or not.
(闰年要能被4整除,或能被100整除,或能被400整除)
[ if(year%4==0 || year%100==0 ||year%400==0)
printf("is a leap year");
else printf("is not a leap year."); ]


登录百度账号

扫二维码下载贴吧客户端

下载贴吧APP
看高清直播、视频!
  • 贴吧页面意见反馈
  • 违规贴吧举报反馈通道
  • 贴吧违规信息处理公示
  • 7回复贴,共1页
<<返回niit吧
分享到:
©2025 Baidu贴吧协议|隐私政策|吧主制度|意见反馈|网络谣言警示