标题:点点滴滴的比较
取消只看楼主
hmsabc
Rank: 2
来 自:贵州省兴义市
等 级:论坛游民
帖 子:97
专家分:19
注 册:2010-8-2
结帖率:100%
 问题点数:0 回复次数:1 
点点滴滴的比较
程序代码:
#include "stdafx.h"
#include <iostream>
using namespace System;

int main(array<System::String ^> ^args)
{
    int apples,oranges;
    int fruit;

    apples = 5; oranges = 6;
    fruit = apples  + oranges;
   
    Console::WriteLine(L"\noranges are not the only fruit...");
    Console::Write(L"- and we have ");
    Console::Write(fruit);
    Console::Write(L" fruits in all.\n");

    int packageCount = 25;
    /*Console::Write(L"There are  ");
    Console::Write(packageCount);
    Console::WriteLine(L" packages.");*/
    Console::WriteLine(L"There are {0} packages.", packageCount);          //一句顶 3 句

    double packageWeight = 9.5;
    Console::WriteLine(L"there are {0} packages weight {1} pounds.",packageCount,packageWeight);
    Console::WriteLine(L"there are {0} packages weight {1:F2} pounds.",packageCount,packageWeight);
    Console::WriteLine(L"there are {0,3} packages weight {1,5:F2} pounds.",packageCount,packageWeight);


    system("pause");
    return 0;
}


这是世界上最笨的学习方法!没有老师教,只好这样学。

搜索更多相关主题的帖子: 点点滴滴 
2010-08-19 16:12
hmsabc
Rank: 2
来 自:贵州省兴义市
等 级:论坛游民
帖 子:97
专家分:19
注 册:2010-8-2
得分:0 
回复 3楼 pangding
这是VS2005自动生成的控制台应用程序,我也不知道哪些参数是什么意思,正在学。
2010-08-20 15:45



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-316214-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 1.244490 second(s), 8 queries.
Copyright©2004-2025, BCCN.NET, All Rights Reserved