指针变量与间址访问能够存放地址值的变量成为指针变量声明:int *p;//在变量说明语句中,*是表示指针类型,也就是用来说明p是存放地址的变量int a=10;p=&a;coutusing namespace std;int main(){long int a=10,b=20,temp;long i...
分类:
编程语言 时间:
2015-04-10 13:22:20
阅读次数:
188
using System;using System.Collections.Generic;using System.Data;using System.Linq;using System.Text;using System.Threading.Tasks;namespace CommonSched...
分类:
Web程序 时间:
2015-04-10 11:13:59
阅读次数:
127
1 #include 2 using namespace std; 3 int Largest(int list[], int length); // list[]:求最大值的函数, 4 int main() 5 { 6 int list[100]; //长度为100的数组 7 ...
分类:
其他好文 时间:
2015-04-10 10:50:11
阅读次数:
150
// 嵌套ifCLR.cpp: 主项目文件。
#include "stdafx.h"
using namespace System;
int main(array ^args)
{
wchar_t letter;
Console::WriteLine(L"Enter a letter: ");
letter = Console::Read();
if(let...
分类:
编程语言 时间:
2015-04-10 09:41:34
阅读次数:
167
//当该点时p-position时,先手输
//当该点为n-position时,即a1^a2......^an = k时;
//先手的第一步是使得a1^a2^.......^an^k = 0;
//那么只要ai^k
#include
#include
#include
using namespace std ;
const int maxn = 10000010 ;
int n...
分类:
编程语言 时间:
2015-04-10 09:41:33
阅读次数:
157
int转string
#include
#include
#include
using namespace std ;
int main()
{
int int_s = 12345 ;
string s ; //声明字符串s
stringstream stream ; //声明stream
stream << int_s ; ...
分类:
其他好文 时间:
2015-04-10 09:41:29
阅读次数:
142
题目传送:蓝桥杯 - 2的次幂表示
思路:这递归递的我头都晕了,先贴个伪递归吧
AC代码:
#include
#include
#include
using namespace std;
void fun1(int a) { //输出2的a次方,因为题目最大就20000,2的15次方足以
if(a == 0) printf("2(0)");
else if(a...
分类:
其他好文 时间:
2015-04-10 09:38:19
阅读次数:
135
#include
using namespace std;
bool findnumberwithsum(int A[],int length,int *num1,int *num2,int key)
{
if(NULL==A||length
return false;
int start=0;
int end=length-1;
int sum=0;
while(start
...
分类:
编程语言 时间:
2015-04-10 09:32:07
阅读次数:
234
题意:从n个数中选取任意个数的数,看是否等于k。
代码给出了十分清晰简洁的优雅递归写法。#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
using namespace std;
typedef long long int LL;
const in...
分类:
其他好文 时间:
2015-04-09 23:53:26
阅读次数:
224
(一)输出其中的最大值。
#include
using namespace std;
int main()
{
int a,b,c,max;
cin>>a>>b>>c;
max=a;
if(b>max)
max=b;
if(c>max)
max=c;
cout<<max<<endl;
}
(二)输出y的值。(1)
#...
分类:
编程语言 时间:
2015-04-09 23:52:27
阅读次数:
375