码迷,mamicode.com
首页 >  
搜索关键字:puts    ( 2099个结果
输入输出函数
标准输入输出流 int getchar(void); int putchar(int ch); char* gets(char*buffer); int puts(const char * string);文件输入输出流 int getc(FILE * stream); int putc...
分类:其他好文   时间:2014-09-10 23:46:41    阅读次数:197
C语言 去掉字符串最后的 *
#include<stdio.h>#include<conio.h>voidproc(char*str){while(*str!=‘\0‘)str++;//将指针移到最后一位str--;while(*str==‘*‘)str--;*(str+1)=‘\0‘;//添加结束符}voidmain(){chars[17]={"****asd***fff***"};puts(s);printf("\n");proc(s);puts(s);}
分类:编程语言   时间:2014-09-09 13:50:39    阅读次数:263
LRTHW练习八
正确代码:formatter = "% {first} % {second} % {third} % {fourth}"puts formatter % {first: 1, second: 2,third: 3,fourth: 4}puts formatter % {first: "one", s...
分类:其他好文   时间:2014-09-02 17:13:35    阅读次数:289
LRTHW笔记七
puts "Mary had a little lamb. "puts "It's fleese was white as #{'snow'}."puts "And everywhere that Mary went."puts "." * 10 # what'd that do?end1 = "C...
分类:其他好文   时间:2014-09-01 22:22:03    阅读次数:146
HDU 1021 Fibonacci Again
题解:找规律……#include int main(){ int n; while(~scanf("%d",&n)){ if((n-2)%4!=0)puts("no"); else puts("yes"); }return 0;}
分类:其他好文   时间:2014-08-30 08:45:09    阅读次数:159
HDU 1012 u Calculate e
题解:直接模拟#include int main(){ puts("n e");puts("- -----------");puts("0 1"); double ans=1.0,f=1.0; for(int i=1;i<=9;i++){ if(i==1)...
分类:其他好文   时间:2014-08-29 19:41:28    阅读次数:162
《七周七语言:理解多种编程范型》のruby课后习题答案
本系列是《七周七语言》的课后习题答案。这本书不拘泥于语法细节,而是横向比较各种编程语言(非热门)之间的编程范式。是本对编程觉悟能有所帮助的好书,这里就不多做介绍了,感兴趣的同学不妨去看一下。不得不说,Ruby的风格很黑客。1. 打印字符串"Hello, world."puts "Hello, wor...
分类:其他好文   时间:2014-08-28 23:54:16    阅读次数:374
ruby学习--block
1 #当前块 2 class Block 3 def a_method 4 return yield if block_given? 5 'no block' 6 end 7 end 8 obj=Block.new 9 puts "#{obj.a_m...
分类:其他好文   时间:2014-08-27 20:18:28    阅读次数:194
ruby学习--varaible
1 #全局变量2 $global_variable=103 class Class14 def print_global()5 puts "Global variable in Class1 is #{$global_variable}"6 end7 end8 cla...
分类:其他好文   时间:2014-08-27 20:08:28    阅读次数:197
Lua1.0 环境准备
从 lua.c 的 main 函数开始,看看在代码执行过程中中发生了什么? ?if?(argc?<?2) ?{ ??puts?("usage:?lua?filename?[functionnames]"); ??return; ?} Lua1.0 执行时至少要有一个参数,否则直接退出...
分类:其他好文   时间:2014-08-26 15:42:16    阅读次数:203
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!