码迷,mamicode.com
首页 >  
搜索关键字:print    ( 43532个结果
排序算法
// sort.cpp : Defines the entry point for the console application.//#include "stdafx.h"#include using namespace std;void print ( int a[] ,int n ){ for...
分类:编程语言   时间:2015-10-08 23:04:38    阅读次数:232
io.StringIO
#! /usr/bin/python # -*-coding:'uft-8'-*-from __future__ import print_function #python2使用py3的print方法import io,sysf=io.StringIO()sys.stdout=f #重定义sy...
分类:其他好文   时间:2015-10-08 20:02:33    阅读次数:163
php 常用函数
$regsall = array_merge(array_unique($regsall)); print_r($regsall);----------------------------------------------------function FetchRepeatMemberInArr....
分类:Web程序   时间:2015-10-08 13:06:58    阅读次数:171
【C语言】输出菱形星号图案
#include<stdio.h> intmain() { inti,j,k; for(i=0;i<=6;i++) { for(j=0;j<=5-i;j++) printf(""); for(k=0;k<=2*i;k++) printf("*"); printf("\n"); } for(i=0;i<=5;i++) { for(j=0;j<=i;j++) printf(""); for(k=0;k<=10-2*i;k++) print..
分类:编程语言   时间:2015-10-07 23:04:46    阅读次数:257
作业4.5-2用for循环打印菱形
package lx;public class lx { public static void main(String[] args) { for(int i = 1;i = i; h--) { System.out.print(" ");//打印空格,从9个到1个 } for(...
分类:其他好文   时间:2015-10-07 22:59:52    阅读次数:136
python 如何找到某一目录下的文件类型(三种方法)
#!/usr/bin/env python1 import glob2 import os3 os.chdir(“./”)4 for file in glob.glob(“*.py”):5 print fileprint “#######Another One##########”impor...
分类:编程语言   时间:2015-10-07 12:00:49    阅读次数:1842
如何查询python帮助文档;sublime 快捷键
# 帮助文档1、dir函数式可以查看对象的属性:Python命令窗口输入 dir(str) 即可查看str的属性。2.如何查看对象某个属性的帮助文档 ? 如要查看str的split属性,可以用__doc__(双下划线), 使用方法为print(str.split.__doc__) 或者help函.....
分类:编程语言   时间:2015-10-07 10:49:42    阅读次数:241
删除字符串中多余的空格
#! /usr/bin/python# -*- coding:'utf-8'-*-text='ab cc sdddd 'print ' '.join(n for n in text.split(' ') if n)data=[]word=''for letter in text: if ...
分类:其他好文   时间:2015-10-06 16:45:08    阅读次数:98
python随机产生4个互不相等的随机数
从0~9中随机产生4个互不相等的数,方法一:import randoms=[]while(len(s)<4): x=random.randint(0,9) if x not in s: s.append(x) print(s)方法二:import random...
分类:编程语言   时间:2015-10-06 16:42:14    阅读次数:173
str.format
#使用str.format()函数 #使用'{}'占位符 print('I\'m {},{}'.format('Hongten','Welcome to my space!')) >>> I'm Hongten,Welcome to my space! print('#' * 40) #...
分类:其他好文   时间:2015-10-06 14:04:29    阅读次数:161
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!