码迷,mamicode.com
首页 >  
搜索关键字:for while until    ( 29426个结果
hdu 1113 Word Amalgamation (map)
# include # include # include # include # include using namespace std; int main() { string s,t; int flag; mapq; while(cin>>s&&s!="XXXXXX") { t=s; sort(s.begin(),s.end()); q[t]=s; } w...
分类:其他好文   时间:2014-08-06 11:56:21    阅读次数:184
关于开源的RTP——jrtplib的使用
session.BeginDataAccess(); if (session.GotoFirstSource()){ do{ RTPPacket *packet; while ((packet = session.GetNextPacket()) != 0){ ...
分类:其他好文   时间:2014-08-06 11:49:51    阅读次数:315
利用栈判断输入的表达式中的括号是否匹配(假设只含有左、右括号)
利用栈判断输入的表达式中的括号是否匹配(假设只含有左、右括号) bool Match(char exp[],int n) {   int i=0;   char e;   bool match=true;   SqStack *st;   InitStack(st);//初始化栈    while(i   {     if(exp[i]=='(')//当前字符为左括号,将其...
分类:其他好文   时间:2014-08-06 10:31:59    阅读次数:225
rwkj 1306 素数========拓展
描述输入二个整数a和b(2main(){ int a,b,max,min,n,m=0,i; while(scanf("%d%d",&a,&b)!=EOF) { max=a>b?a:b; min=a=min) { for...
分类:其他好文   时间:2014-08-06 01:44:40    阅读次数:239
nyist 22 素数求和
#includeint main(){int m,n,i,j,a,b;scanf("%d\n",&m);while(m--) // m组数据 { int sum=0; scanf("%d\n",&n); // 某一组 n个数 for(i=0;i<n;i+...
分类:其他好文   时间:2014-08-06 01:38:30    阅读次数:177
15.求函数:sin(x)=x/1! - x3/3! + x5/5! -x7/7! +…,最后一项精度不低于0.000001
#include using namespace std;int main(){ double x,sinx=0.0,jbf,j=1.0; cin>>x; jbf=x; int k=1,l=1; double n=1; while(j>=1e-6) { j=jbf/n; s...
分类:其他好文   时间:2014-08-05 22:25:40    阅读次数:259
js循环GridView判断CheckBox是否全部未选中
functionisQueryPriceReplyProduct(){ vargridItem; varitemIndex=0; varIDS=''; while(gridItem=dgQueryPriceReplyProduct.Table.GetRow(itemIndex)){ ...
分类:Web程序   时间:2014-08-05 22:05:00    阅读次数:220
Set Matrix Zeroes
问题:将数组中的某个值为0的元素所在行和列的其他值都为0分析;遍历数组找到某一值为0然后遍历他的上下左右直到边界,要用while而不能用搜索,因为搜索过去新节点的操作以旧结点一样的操作 要用一个新数组,不然原数组修改后会影响到下次的查找class Solution {public: vo...
分类:其他好文   时间:2014-08-05 21:59:30    阅读次数:176
HDU 4915 Parenthese sequence _(:зゝ∠)_ 呵呵
呵呵不是我做的 #include #include #include const int N = 1000000 + 10; char s[N]; int d[N], num[N]; int main() { while (~scanf("%s", s)) { memset(num, 0, sizeof num); int len = strlen...
分类:其他好文   时间:2014-08-05 19:25:10    阅读次数:218
HDU 4920 稀疏矩阵相乘
暴力啊,不要想太多 T^T g艹太坑爹了 #include #include #include using namespace std; const int MAX_N = 807; int n; int a[MAX_N][MAX_N], b[MAX_N][MAX_N]; int c[MAX_N][MAX_N]; int main() { while (1 == scan...
分类:其他好文   时间:2014-08-05 19:24:11    阅读次数:251
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!