C程序设计及应用课后题答案.pdfVIP

  • 3
  • 0
  • 约3.07万字
  • 约 21页
  • 2022-07-21 发布于江苏
  • 举报
4 、分别写出下列语句执行的结果。 1) Console.WriteLine({0}--{0:p}good,12.34F); 2) Console.WriteLine({0}--{0:####}good,0); 3) Console.WriteLine({0}--{0:00000}good,456); 【解答】 12.34--1,234.00%good 0--good 456--00456good 5 、编写一个控制台应用程序,输出1 到5 的平方值,要求: 1) 用for 语句实现。 2) 用while 语句实现。 3) 用do-while 语句实现。 【解答】 using System; using System.Collections.Generic; using System.Text; namespace outputSquareValue { class Program { static void Main() { //用for 语句实现 for (int i = 1; i = 5; i++) { Console

文档评论(0)

1亿VIP精品文档

相关文档