码迷,mamicode.com
首页 >  
搜索关键字:for while until    ( 29426个结果
小算法
1. 一个机构要为新学员分配住宿,一共有x个学员,每个房间能住6人,用一个公式来计算需要的房间数. 答案:(x+5)/6. 这个同样适用于分页问题,x就是总记录数,6就是每页显示数。2. 让x值在0到9之间不断循环变化,写出相应的代码:int x=0;while(true){x=(x+1)%10;}...
分类:其他好文   时间:2014-07-01 19:28:53    阅读次数:143
编译tuxedo服务遇到的问题
编译服务程序报的各种错: 1.  环境变量配置好后运行tmboot –y启动管理进程和服务进程 2.  报类似这样的错:buildserv:error while loading shared libraries:libtux.so:can't openshared object file。解决如下: exportLD_LIBRARY_PATH=$ LD_LIBRARY_PATH:/home...
分类:其他好文   时间:2014-07-01 15:54:32    阅读次数:1571
POJ - 1731 Orders
题意:排序后字符串全排列 思路:好久没水一题了 #include #include #include #include using namespace std; const int MAXN = 220; char str[MAXN]; int main() { while (scanf("%s", str) != EOF) { int n = strlen(str); ...
分类:其他好文   时间:2014-07-01 15:09:17    阅读次数:182
2440裸机串口调试 while(!(rUTRSTAT0 & 0x2));问题
前两天写RTC中断 使用串口输出 发现程序会出现while(!(rUTRSTAT0 & 0x2));出不来的情况,但是中断是正常运作的 解决方法: main函数增加: U32 mpll_val = 0,consoleNum; Port_Init(); //定义在2440lib.c...
分类:其他好文   时间:2014-07-01 14:36:56    阅读次数:459
Lua学习(3)——控制结构
Lua提供了一组传统的,小巧的控制结构,包括用于条件执行的if,用于迭代的while、repeat和for。所有的控制结构都有一个现实的终止符号:if for while 都以end结尾,repeat以until作为结尾。控制结构中的条件表达式可以使任何的值,Lua将所有false和nil的值视为“...
分类:其他好文   时间:2014-07-01 12:41:38    阅读次数:253
数据库中获取汉字的首字母(网上某大神的)
create function fun_getPY(@str nvarchar(4000))returns nvarchar(4000)asbegindeclare @word nchar(1),@PY nvarchar(4000)set @PY=''while len(@str)>0beginse...
分类:数据库   时间:2014-07-01 11:57:32    阅读次数:258
LinkedBlockingQueue多线程测试
public class FillQueueThread extends Thread { private Queue queue; public FillQueueThread(Queue queue){ this.queue = queue; } @Override public void run() { while(true){ try { boolean a...
分类:数据库   时间:2014-07-01 11:20:37    阅读次数:332
php实现目录下的文件读取功能
//这里实现 某个文件下的所有图片,并列出来! header("Content-type:text/html;charset=utf8");   $handle=opendir('.'); echo "目录 handle: $handle\n"; echo "档案:\n"; while ($file = readdir($handle)) {    if(@eregi("[_\.0-...
分类:Web程序   时间:2014-07-01 11:19:52    阅读次数:233
Oracle连接出错(一)
1、错误描述 java.sql.SQLException: ORA-0064:error occurred at recursive SQL level 1. ORA-06153:unable to extend table SYS.AUD$ by 8192 in tablespace SYSTEM. ORA-02002:error while writing to audit trail. O...
分类:数据库   时间:2014-07-01 08:01:47    阅读次数:463
几个 bash shell的例子
Ø  读取文件的时间 #!/bin/bash for file in `ls /root` do     stat $file>1.txt sed -n "7p" 1.txt>2.txt usetime= awk -F ":" '{print $2}' 2.txt echo "time="$file $usetime done       Ø  读取文件的每行while...
分类:其他好文   时间:2014-07-01 06:49:51    阅读次数:204
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!