c语言编程题,急急急!

Python011

c语言编程题,急急急!,第1张

我用C++写的,只要把几个输入输出函数改一下,就跟C一样了

#include<iostream>

#include<cstdlib>

#include<ctime>

using namespace std

void main()

{

char ary_num[240]={}

int n=0,s

cout<<"请输入一个正整数(必须小于等于240位):"

gets(ary_num)

for(int i=0ary_num[i]!=0i++)

n++

cout<<"这个数有多少位? n="<<n<<endl

cout<<"想去掉其中多少个数字?(s必须小于n)s="

cin>>s

cout<<endl

srand(clock())

for(int i=1i<si++)

{//删掉任意s位数

int num_del=rand()%(n+1)

if(num_del!=n)

for(int j=num_delj<nj++)

ary_num[j]=ary_num[j+1]

else

n--

}

for(int i=0i<ni++)

{//把剩余数字按从大到小排序

for(int j=ij<nj++)

if(ary_num[j]>ary_num[i])

{

char temp=ary_num[j]

ary_num[j]=ary_num[i]

ary_num[i]=temp

}

}

ary_num[n-1]='\0'

cout<<"剩余数字组成最大整数为:"

puts(ary_num)

cout<<endl

system("pause")

}

#include<stdio.h>

void main()

{

int s=0,n

printf("请输入n的值")

scanf("%d",&n)

for(int i=1i<=ni++)

s+=1/i

printf("1/2+1/3+1/4+...+1/n的结果是%d\n",s)

}

Microsoft Visual C++ (often abbreviated as MSVC) is a commercial integrated development environment (IDE) product engineered by Microsoft for the C, C++, and C++/CLI programming languages. It has tools for developing and debugging C++ code, especially code written for the Microsoft Windows API, the DirectX API, and the Microsoft .NET Framework.

History

The predecessor to Visual C++ was called Microsoft C/C++.

Visual C++ 1.0, which included MFC 2.0, was the first version of Visual C++, released in 1992, available in both 16-bit and 32-bit versions.

Visual C++ 1.5, which included MFC 2.5, added OLE 2.0 and ODBC support to MFC. It was 16-bit only and was the first version of Visual C++ that came only on CD-ROM.

Visual C++ 1.52c was a patched version of 1.5, but deserves its own entry since it is the last, and arguably most popular, development platform for Microsoft Windows 3.x. It is available through Microsoft Developer Network.

Visual C++ 2.0, which included MFC 3.0, was the first version to be 32-bit only. In many ways, this version was ahead of its time because Windows 95, then codenamed "Chicago", was not released, and Windows NT had only a small market share. As a result, this release was almost a "lost generation". Updates available through subscription included version 2.1 and 2.2. Microsoft included and updated Visual C++ 1.5 as part of the 2.x releases up to 2.1, which included Visual C++ 1.52, and both 16-bit and 32-bit version of the Control Development Kit (CDK) were included. Visual C++ 2.x also supported Win32s development. It is available through Microsoft Developer Network. There was a Visual C++ 2.0 RISC Edition for MIPS and Alpha processors.

Visual C++ 4.0, which included MFC 4.0, was designed for Windows 95 and Windows NT. To allow support of legacy (Windows 3.x/DOS) projects, 4.0 came bundled with the Visual C++ 1.52 installation CD. Updates available through subscription included Visual C++ 4.1, which came with the Microsoft Game SDK (later released separately as the DirectX SDK), and Visual C++ 4.2. Neither 4.1 nor 4.2 supported Windows 3.x (Win32s) development.

Visual C++ 5.0, which included MFC 4.21, was a major upgrade from 4.2.

Visual C++ 6.0 (commonly known as VC6), which included MFC 6.0, was released in 1998. The release was somewhat controversial since it did not include an expected update to MFC. Visual C++ 6.0 is still quite popular and often used to maintain legacy projects. There are however issues with this version under Windows XP, especially under the debugging mode (ex: the values of static variables do not display). The debugging issues can be solved with a patch called the "Visual C++ 6.0 Processor Pack" downloadable from http://msdn2.microsoft.com/en-us/vstudio/aa718349.aspxcuriously, this page stresses that Users must also be running Windows 98, Windows NT 4.0, or Windows 2000., though these requirements probably are the minimum, which means that any computer with these version of Windows or later will run the patch.

Visual C++ .NET 2002 (known also as Visual C++ 7.0), which included MFC 7.0, was released in 2002 with support for link time code generation and debugging runtime checks, .NET 1.0 and Visual C# and managed C++ extensions for .NET. The new user interface used many of the hot keys and conventions of Visual Basic, which accounted for some of its unpopularity among C++ developers.

Visual C++ .NET 2003 (known also as Visual C++ 7.1), which included MFC 7.1, was released in 2003 along with .NET 1.1 and was a major upgrade to Visual C++ .NET 2002. It was considered a patch to Visual C++ .NET 2002 and shipped for minimal cost to owners of that version. This is the last version to support Windows 95 as a target.

eMbedded Visual C++ was used to develop for the Windows CE operating system. eMbedded Visual C++ was replaced as a separate development environment by Microsoft Visual Studio 2005.

Visual C++ 2005 (known also as Visual C++ 8.0), which included MFC 8.0, was released in November 2005. This version supports .NET 2.0 and dropped managed C++ for C++/CLI. It also introduced OpenMP. With Visual C++ 2005, Microsoft also introduced Team Foundation Server. Visual C++ 8.0 has problems compiling MFC AppWizard projects that were created using Visual Studio 6.0, so maintenance of legacy projects can be continued with the original IDE if rewriting was not feasible.

Visual C++ 2008 (known also as Visual C++ 9.0) was released in November 2007. This version supports .NET 3.5, and it is currently the latest stable release.

Current editions

There are four current versions of Visual C++ available:

Microsoft Visual C++ 2008 Express Edition

Microsoft Visual Studio 2008 Standard

Microsoft Visual Studio 2008 Professional

Microsoft Visual Studio 2008 Team System

Visual C++ is included in Visual Studio.

Microsoft Visual C++ 2008 Express is available as a free download at the MSDN site.

Microsoft Visual C++ 2005 Express is available as a free download at the MSDN site under "Previous Version".

Visual C++ 2008 Express

Main article: Microsoft Visual Studio Express

This Microsoft Visual C++ (or Visual C++ 9.0) is available in two flavors: as a part of Microsoft Visual Studio and as a standalone "Express Edition" product. Both should be available for MSDN subscribers and were released officially in November of 2007.

Microsoft Visual C++ 2008 Express Edition is available from the Microsoft Developer Network (MSDN) web site as a free download.

64-bit

Visual Studio 2008 Standard and Professional editions have x64 compiler support, and Visual Studio 2008 Team Suite supports both x64 and IA-64. Prior to Visual C++ 2005, the Platform SDK was the only way for programmers to develop 64-bit Windows applications. The SDK included both a compiler and a Visual C++ 6.0 library for the the x64-target. Programmers who wanted the 64-bit versions of the Visual C++ .NET 2003 libraries (which are no longer available) had to contact [email protected].

-----------

Microsoft Visual C++,(简称Visual C++,MSVC,VC++或VC)微软公司的C++开发工具,具有集成开发环境,可提供编辑C语言,C++以及C++/CLI等编程语言。VC++整合了便利的除错工具,特别是整合了微软视窗程式设计(Windows API)、三维动画DirectX API,Microsoft .NET框架。目前最新的版本是Microsoft Visual C++ 2008。

风格

Visual C++以拥有“语法高亮”,IntelliSense(自动编译功能)以及高级除错功能而著称。比如,它允许用户进行远程调试,单步执行等。还有允许用户在调试期间重新编译被修改的代码,而不必重新启动正在调试的程序。其编译及建置系统以预编译头文件、最小重建功能及累加连结著称。这些特徵明显缩短程式编辑、编译及连结的时间花费,在大型软体计画上尤其显著。

历史

Visual C++最初叫做Microsoft C/C++.

Visual C++ 1.0,集成了MFC 2.0,是Visual C++第一代版本,1992年推出,可同时支援16位元与32位元版,可算是Microsoft C/C++ 7.0的更新版本。

Visual C++ 1.5, 集成了MFC 2.5, 增加了“目标文件链接嵌入 (OLE)2.0 和支持MFC的开放式数据库链接(ODBC)。这个版本只有16位的,也是第一个以CD-ROM为软件载体的版本。这个版本也没有所谓“标准版”。它是最后一个支持16位软件编程的软件,也是第一个支持基于x86机器的32位编程软件。

Visual C++ 2.0, 集成了MFC 3.0,第一个只发行32位的版本。不幸的是,这个版本提前发行了,几乎成了一个“丢失的版本”。这是因为那个时候 Windows 95(开发代码为"Chicago")还没有发行,而Windows NT又只占有很小的市场份额。该版本用户可以通过微软公司的订阅服务(Microsoft Subscription Service)升级至2.1和2.2版本。微软公司在这个版本中集成并升级了Visual C++ 1.5,作为2.0版本(Visual C++ 1.5升级后版本号: 1.51)以及2.1版本(Visual C++ 1.5升级后版本号: 1.52)的一部分。Visual C++ 2.x附带了16位和32位版本的CDK,同时支持Win32s的开发。Visual C++ 2.2及其后续版本不再升级Visual C++ 1.5 (尽管它一直被集成至Visual C++ 4.x)。尽管出生的比Windows 95早,这个版本的发行日期还是非常接近Windows 95,可是当Windows 95发行时, Visual C++ 4.0也已经发行了。因此很多程序开发者直接从1.x过渡到4.0,把2.x跳过去了。

Visual C++ 4.0, 集成了MFC 4.0, 这个版本是专门为Windows 95以及Windows NT设计的。用户可以通过微软公司的订阅服务(Microsoft Subscription Service)升级至4.1和4.2版本(此版本不再支持Win32s开发)。

Visual C++ 5.0, 集成了MFC 4.21,是4.2版以来比较大的一次升级。

Visual C++ 6.0, 集成了MFC 6.0,于1998发行。发行至今一直被广泛地用于大大小小的项目开发。但是,这个版本在Windows XP下运行会出现问题,尤其是在调试模式的情况下(例如: 静态变量的值并不会显示)。 这个调试问题可以通过打一个叫“Visual C++ 6.0 Processor Pack”的补丁来解决。奇怪的是,这个网页强调用户也必须运行Windows 98、Windows NT 4.0、或Windows 2000。

Visual C++ .NET 2002 (也即Visual C++ 7.0),于2002年发行,集成了 MFC 7.0,支持链接时代码生成和调试执行时检查。这个版本还集成了Managed Extension for C++,以及一个全新的用户界面(与Visual Basic和Visual C#共用)。这也是为什么Visual C++ 6.0仍然被广泛使用的一个主要原因。

Visual C++ .NET 2003 (也即 Visual C++ 7.1),集成了MFC 7.1,于2003年发行,是对Visual C++ .NET 2002的一次重大升级。

eMbedded Visual C++,用于Windoww CE操作系统。Visual C++作为一个独立的开发环境被Microsoft Visual Studio 2005所替代。

Visual C++ 2005 (也即Visual C++ 8.0),集成了MFC 8.0,于2005年11月发布。这个版本引进了对C++/CLI语言和OpenMP的支持。

Visual C++ 2008 (也即Visual C++ 9.0),于2007年11月发布。这个版本支持.NET 3.5,是目前最新的版本。

最新版本

Visual C++ 目前有四种最新版本:

Visual C++ 2005 简化版

Microsoft Visual Studio 2005 标准版

Microsoft Visual Studio 2005 专业版

Microsoft Visual Studio 2005 团队套装版

Visual C++被整合在Visual Studio之中。

Microsoft Visual C++ 2005 Express 可从MSDN的网站免费下载使用。