hyetpang 2015-09-10 07:52 采纳率: 39.4%
浏览 1821

c#中的字符串输出问题

using System;
using System.Collections.Generic;
using System.Text;

namespace 遍历数组
{
class Program
{
static void Main(string[] args)
{
int passed=0;
int[] score = new int[] { 98, 76, 87, 65, 55, 68, 57, 84, 91, 100, 58, 76 };
foreach (int x in score )
if (x >= 60)
{
passed++;
Console.Write("{0,-4}",x );
}
Console.WriteLine("\n及格率:{0:p}",(double )passed /score .Length );
}
}
}
最后一个输出中,{0:p}是什么意思?


  • 写回答

4条回答 默认 最新

  • GodModeaa 2015-09-10 07:54
    关注

    0是参数索引,P应该是格式中的%

    评论

报告相同问题?

悬赏问题

  • ¥15 ads仿真结果在圆图上是怎么读数的
  • ¥20 Cotex M3的调试和程序执行方式是什么样的?
  • ¥20 java项目连接sqlserver时报ssl相关错误
  • ¥15 一道python难题3
  • ¥15 用matlab 设计一个不动点迭代法求解非线性方程组的代码
  • ¥15 牛顿斯科特系数表表示
  • ¥15 arduino 步进电机
  • ¥20 程序进入HardFault_Handler
  • ¥15 oracle集群安装出bug
  • ¥15 关于#python#的问题:自动化测试