码迷,mamicode.com
首页 >  
搜索关键字:for while until    ( 29426个结果
素数判定
Problem Description对于表达式n^2+n+41,当n在(x,y)范围内取整数值时(包括x,y)(-39int main(){ int x,y,i,n,t,flag; while(scanf("%d%d",&x,&y)!=EOF&&(x!=0||y!=0))//又学会了一招·...
分类:其他好文   时间:2014-07-31 19:52:57    阅读次数:252
把字符串转化成整型显示
用法./change 23456 10, 按最后指定的进制显示 #include #include #include int mystrlen(char *s) {    int len=0;    char *temp=s;    while(*(temp)!='\0')    {       ++len;       ++temp;    }    return le...
分类:其他好文   时间:2014-07-31 16:57:06    阅读次数:224
hdoj 1087 (DP)
代码:#include #include using namespace std; int a[1005], dp[1005]; int main() { int n,sum,i,j; while( scanf("%d",&n)&&n){ for( i=0; ia[j]) dp[i]=max...
分类:其他好文   时间:2014-07-31 16:42:26    阅读次数:151
不定参数的格式化
#include#includestd::string formatt(const char * format,...){ va_list args; (void)va_start(args,format); std::string retstr; size_t size = 1024; while...
分类:其他好文   时间:2014-07-31 16:23:06    阅读次数:187
leetcode--009 Linked List Cycle I
1 public boolean hasCycle(ListNode head) { 2 ListNode s=head; 3 ListNode f=head; 4 while(f!=null&&f.next!=null){ 5 ...
分类:其他好文   时间:2014-07-31 16:14:27    阅读次数:223
leetcode--010 Linked List Cycle II
1 public ListNode detectCycle(ListNode head) { 2 ListNode s=head; 3 ListNode f=head; 4 while(f!=null&&f.next!=null){ 5 ...
分类:其他好文   时间:2014-07-31 16:01:36    阅读次数:167
Mac里配置Eclipse + GDB
在Eclipse里调试c程序, 出现: "Error while launching command: gdb -version"。需要让Eclipse知道Eclipse具体在什么地方,配置方法是: "Debug configuration"-->"Debugger"-->"GDB debugger"里的"gdb"改成gdb的绝...
分类:数据库   时间:2014-07-31 13:48:16    阅读次数:3416
xtu read problem training B - Tour
B -TourTime Limit:1000MSMemory Limit:65536KB64bit IO Format:%I64d & %I64uDescriptionJohn Doe, a skilled pilot, enjoys traveling. While on vacation, he...
分类:其他好文   时间:2014-07-31 13:05:16    阅读次数:287
用C#写的几种排序算法
1、冒泡法排序class Program{//冒泡法排序public static void sort(int[] list){int i, j, temp;j = 1;while (j list[i + 1]){temp = list[i];list[i] = list[i + 1];list[....
分类:其他好文   时间:2014-07-31 13:00:46    阅读次数:152
记录不同单词数目
#include #include int main(){char c,str[1000][1000],flag = 0,count; int x,y,i,j;while(1) { x = 0; y = 0;while((c = getchar() )!= '\n'){if (c == '#'){f...
分类:其他好文   时间:2014-07-31 12:41:36    阅读次数:246
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!