码迷,mamicode.com
首页 >  
搜索关键字:return    ( 60766个结果
(c语法百题11)输入一个数 ,输出其绝对值
知识点:if语句内容: 输入一个数 ,输出其绝对值。输入说明:一行一个整数输出说明:一行一个整数输入样例:-3输出样例 :3#include int main(){ int a; scanf("%d",&a); if (a<0) { a=-a; } printf("%d\n",a); return....
分类:其他好文   时间:2014-08-04 01:45:56    阅读次数:213
hdoj 1089(费马小定理)
题目大意:方程f(x)=5*x^13+13*x^5+k*a*x;输入任意一个数k,是否存在一个数a,对任意x都能使得f(x)能被65整出。现假设存在这个数a ,因为对于任意x方程都成立所以,当x=1时f(x)=18+ka又因为f(x)能被65整出,故设n为整数可得,f(x)=n*65;即:18+ka...
分类:其他好文   时间:2014-08-04 01:44:56    阅读次数:298
poj2632--模拟
/** \brief poj 2632 * * \param date 2014/8/3 * \param state AC * \return memory 776k time 16ms * */ #include #include #include using namespace std; const int MAXN=101; int Map[MAXN][MAXN];...
分类:其他好文   时间:2014-08-03 23:24:46    阅读次数:293
[LeetCode] Pascal's Triangle II
Given an index k, return the kth row of the Pascal's triangle.For example, given k = 3, Return [1,3,3,1].Note: Could you optimize your algorithm to us...
分类:其他好文   时间:2014-08-03 23:10:36    阅读次数:179
(转)zigbee >TI Z-stack协议栈各种地址的获取
第一种方法,利用NLME.h里面定义的专门API获取设备自身IEEE地址/** This function will return a pointer to the device's IEEE 64 bit address** This function resides in nwk_util.c....
分类:其他好文   时间:2014-08-03 20:21:55    阅读次数:351
皇后问题
递归回溯代码#include using namespace std;int n,m, a[10];bool bz[3][10];void DFS(int k){ int i;if (k==n) { for ( i=0; i>n; DFS(0);return 0;}V...
分类:其他好文   时间:2014-08-03 17:52:45    阅读次数:299
Python基础篇(六)
retun空值,后面的语句将不再被执行 >>> def test(): ... print("just a test!") ... return ... print("will not be print") ... >>> test() just a test! 和Java类似,...
分类:编程语言   时间:2014-08-03 17:51:05    阅读次数:336
Remove Duplicates from Sorted Array
问题:将有序的数组中重复的数字去掉分析:由于有序所以只用和前一个比较就行class Solution {public: int removeDuplicates(int A[], int n) { int i,j; if(n==0 || n==1) return n...
分类:其他好文   时间:2014-08-03 17:42:35    阅读次数:204
typedef函数指针使用方法
1.简单的函数指针的应用形式1:返回类型(*函数名)(參数表)char (*pFun)(int); char glFun(int a){ return;} void main() { pFun = glFun; (*pFun)(2); } 第一行定义了一个指针变量pFun。首先...
分类:其他好文   时间:2014-08-03 15:13:05    阅读次数:225
扩展欧几里得
static long x, y; public static long exgcd(long a, long b) { if (b == 0) { x = 1; y = 0; return a; } long r = exgcd(b, a % b); long t = x; x = y; y = t - a / b * y; return...
分类:其他好文   时间:2014-08-03 12:50:15    阅读次数:268
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!