c++代碼大全及注解
秘受15535508610咨詢: C++程序注釋 -
普安縣釘回復:
______ 樣例:Input p=3 * *** ***** * * *** *** ***** ***** * * * *** *** ******** ***** ***** Input p=5 * *** ***** * * *** *** ***** ***** * * * *** *** *** ***** ***** ***** * * * * *** *** *** *** ***** ***** ***** ***** * * * * * *** *** *** *** ******** ***** ***** ***** ***** 可見,p為大三角的層...
秘受15535508610咨詢: c++編程及注釋
普安縣釘回復:
______ 先得到字符串長度,for循環(huán)就可以了
秘受15535508610咨詢: 給C++代碼加上注釋
普安縣釘回復:
______ 這應該是MFC和ADO結合的代碼 _ConnectionPtr m_pCon; //生成一個ADO連接對象(相當于C#里的sqlconnection,簡單的去理解)_RecordsetPtr m_pRs;//生成一個ADO數(shù)據(jù)集(相當于C#里的dataset,簡單的去理解) try{ CString sql=_T...
秘受15535508610咨詢: 解釋一個簡單的C++程序 -
普安縣釘回復:
______ ofstream outFile("my.out");//這句是打開一輸出流文件名字為my.out if(! outFile) {cerr<<"cannot open my.out"<<endl; exit(1); }//如果打開失敗則退出 int n=50; float f=20.3; outFile<<"n="<<n<<endl;//往文件my.out里輸入"n=和n的值 outFile<<"f="<<f<<endl;//往文件my.out里輸入"f=和f的值 其實下面應該關閉文件,代碼沒給出.
秘受15535508610咨詢: 求給一個C++程序注釋!!程序代碼如下:謝謝!//后注釋即可
普安縣釘回復:
______ #includeamp;lt;iostream.hamp;gt;nbsp;#includeamp;lt;iomanip.hamp;gt;nbsp;#includeamp;lt;stdio.hamp;gt;//nbsp;nbsp;nbsp;nbsp;nbsp;nbsp;nbsp;遞歸法nbsp;#includenbsp;amp;lt;stackamp;gt;nbsp;//nbsp;nbsp;nbsp;nbsp;nbsp;nbsp;nbsp;堆...
秘受15535508610咨詢: 下列事例的描述中,不能說明同屬中不同種類之間生存斗爭非常激烈的...
普安縣釘回復:
______ 12345678910111213141516171819202122232425262728293031323334353637383940 #include<iostream> usingnamespacestd; voidrow(inta[],intn,intnRow=10) //從數(shù)組中,刪除指定的數(shù)據(jù),(nRow沒有用上) { for(inti=0;i<10;i++) //循環(huán)...
秘受15535508610咨詢: C++題目,希望能給出完整代碼~ -
普安縣釘回復:
______ 要不區(qū)分大小寫,修改了一下一樓的代碼. #include <string> int main(){ std::string str; std::string sub; std::cout << " 輸入長的字符串" << endl; std::cin >> str; std::cout << " 輸入短的字符串" << endl; std::cin >> sub; std::string str; std::...
秘受15535508610咨詢: 簡單C++源代碼糾錯 -
普安縣釘回復:
______ #include <iostream>#include <string> using namespace std; int main () { string s; int a[1001]; cin>>s; a[0] = s.length(); for (int i = 1;i <= a[0];i++) { if (s[i-1]>=0+48&&s[i-1]<=9+48) a[i] = s[a[0]-i] - '0'; else a[i] = s[a[0]-i] - 'A' + 10; // s[i-1] 不能為負,...
秘受15535508610咨詢: 求這個c++程序的 注釋
普安縣釘回復:
______ #include<stdio.h> #include<conio.h> int arr[1000000]={0}; void mul(int arr[],int n,int *len) //傳入?yún)?shù) arr[]表示一個數(shù), n表示當前與arr乘的數(shù), *len是長度{ int c=0,i,l=*len;//初始化,C表示進位for(i=0;i<l;i++) { arr[i]=arr[i]*n+c; //每一位乘以n再加上...