[C++] 纯文本查看 复制代码
#include "stdafx.h"
using namespace System;
int main(array<System::String ^> ^args)
{
int a = 10;
float b = 5.7;
Console::WriteLine(L"a = {0} and b = {1}", a, b);
Console::ReadLine(); //等待用户输入回车后才往下走,这里阻止调试运行时窗口一闪而过。
return 0;
}
[C++] 纯文本查看 复制代码
#include "stdafx.h"
using namespace System;
int main(array<System::String ^> ^args)
{
int a = 10;
float b = 5.734;
Console::WriteLine(L"a = {0} and b = {1:F2}", a, b);
Console::ReadLine();
return 0;
}
[C++] 纯文本查看 复制代码
#include "stdafx.h"
using namespace System;
int main(array<System::String ^> ^args)
{
int a = 10;
float b = 5.7345;
Console::WriteLine(L"a = {0,5} and b = {1,5:F3}", a, b);
Console::ReadLine();
return 0;
}