⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 soln4_5.cpp

📁 Wrox.Ivor.Hortons.Beginning.Visual.C.Plus.Plus.2008 With sourcecode
💻 CPP
字号:
// Soln4_5.cpp : main project file.

#include "stdafx.h"
 
using namespace System;

int main(array<System::String ^> ^args)
{
  Random^ generator = gcnew Random;
  int number = generator->Next(0,Int32::MaxValue-10000) + 10000;
  Console::WriteLine(L"The value is {0}", number);

  array<String^>^ digitWord = {L" zero", L" one", L" two", L" three", L" four",
                           L" five", L" six", L" seven", L" eight", L" nine"};
  String^ inWords = L"";

  while(number > 0)
  {
    // Use the rightmost digit in number to index the digitWord array
    // and prefix the select word to inWords.
    inWords = digitWord[number % 10] + inWords;
    number /= 10;                 // Remove the rightmost decimal digit
  }
  Console::WriteLine(inWords);
  return 0;
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -