pggw.net
当前位置:首页 >> 用C语言编程:编写一个函数,重复打印给定的字符N次 >>

用C语言编程:编写一个函数,重复打印给定的字符N次

你好!void printCharNTimes(char c,int n){int i;for(i=0;i 评论0 0 0

char prin(char x)//x为给定字符 { int i; for(i=0;i printf("%c",x); }

void f(char k,int num) { int i; for(i=0;i printf("%3c",k); printf("\n"); }

void printn(char c,int n){ while(n-->0) printf("%c",c);}

#include <stdio.h>int main(void){char n;printf("请输入要打印的字符 : ");scanf("%c",&n);for( ; ; ){printf("%c\n\v",n);}return 0 ;}

#include<stdio.h> void printchar(char a,int n){ for(int i=0;i<n;i++){ printf("%c",a);} } int main(){ printf("请输入打印字符"); char a; scanf("%c",&a); printf("请输入打印次数"); int n; scanf("%d",&n); printchar(a,n); return 0; }

编写一个函数,重复打印给定的字符N次. 用C实现. char prin(char x)//x为给定字符 { int i; for(i=0;i<N;i++)//N为指定次数 printf("%

建立一个“command1",再输入下面的代码:Private Sub Command1_Click()Dim n%, k%m = InputBox("请输入要打印的字符:")n = InputBox("请输入打印字符的次数:")For k = 1 To nPrint mNextEnd Sub

vb6 sub print(N as integer,c as string) for i = 1 to N print c next end sub 这个是每打印一次占一行 如果你要打印在一起的话 sub print(N as integer,c as string) dim i as integer,s as string s="" for i = 1 to N s=S & c next print s end sub

#include main() { int i,n,s=1; scanf("%d",&n); for(i=1;i{s*=i; } printf("%d!=%d\n",n,s); }

网站首页 | 网站地图
All rights reserved Powered by www.pggw.net
copyright ©right 2010-2021。
内容来自网络,如有侵犯请联系客服。zhit325@qq.com