#鱼C五周年嘉年华#《C趣味》--第一发
终于等到1.23这个普鱼同庆的好日子啦 悄悄告诉你们我是来送鱼币的啦 {:5_97:}
今天上个开胃菜 让大家开开胃不仅回帖有机会获得鱼币 写出你的程序 也能获得大量鱼币哟 小伙伴们 你们准备好了吗? #鱼C五周年嘉年华#之《C趣味》正式启动啦{:5_95:}
微辣小菜:写一个满屏的不动的”Welcome to Fishc“
中辣小菜:写一个要动的"Welcome to Fishc "
特辣小菜:用"*"来写一个 "Fishc"
大概最后的就像下面这样的效果:(具体多少个* 由你自己决定)大小写也由你自己决定
***** ** * * * * *****
* * * *
***** ** * ***** *
* ** * * * *
* ** * * * * * *****
先来报道! 我也要参加,哈哈哈哈哈.........:lol::lol::lol: ╭(╯ε╰)╮ 微辣小菜:
#include <stdio.h>
void main()
{
inti;
for (i=0;i < 100;i++)
{
printf("Welcome to Fishc ");
}
} 中辣小菜:
#include <stdio.h>
#include <windows.h>
void main()
{
inti , j;
for (i=0;i < 65;i++)
{
for (j=0 ;j < i ;j++)
{
printf(" ");
}
printf("Welcome to Fishc");
system("cls");
}
} 微辣小菜:
满屏是刚好满还是什么。。。。随便写了。。。
#include<stdio.h>
int main()
{
int i,j;
for(i=1;i<15;i++)
{
for(j=1;j<10;j++)
{
printf("Welcome to Fishc ");
}
}
return 0;
}
中辣小菜:
防止重复啦~:lol:
#include<stdio.h>
#include<windows.h>
int SetPos(int x,int y) //设置光标位置
{
HANDLE hOut;
COORD pos= {x,y};
hOut = GetStdHandle(STD_OUTPUT_HANDLE);
SetConsoleCursorPosition(hOut, pos);
return 0;
}
int main()
{
int i,j;
for(i=0;i<=50;i++)
{
for(j=0;j<60;j+=2)
{
SetPos(j,i);
printf("Welcome to Fishc");
Sleep(100);
system("cls");
}
}
return 0;
} 特辣小菜:
#include<stdio.h>
#include<windows.h>
int SetPos(int x,int y) //设置光标位置
{
HANDLE hOut;
COORD pos= {x,y};
hOut = GetStdHandle(STD_OUTPUT_HANDLE);
SetConsoleCursorPosition(hOut, pos);
return 0;
}
int main()
{
int i,j;
for(i=0;i<10;i++)
{
for(j=0;j<10;j++)
{
if(i==0 || i==4 || j==0)
{
printf("*");
}
}
printf("\n");
}
for(i=0;i<10;i++)
{
SetPos(12,i);
for(j=0;j<10;j++)
{
if(j==4 || j==5 )
{
printf("*");
}
else
{
printf(" ");
}
}
}
for(i=0;i<10;i++)
{
SetPos(24,i);
for(j=0;j<10;j++)
{
if((i==0&& j==7)||(i==9 && j==0))
{
printf("***");
}
else if((i==1 && j==3)|| (i==5 && j==5)|| (i==8 && j==5)||(i==4 && j==3))
{
printf("**");
}
else if((i==2 && j==0)|| (i==7 && j==9) || (i==3 && j==0)|| (i==6 && j==9))
{
printf("*");
}
else
{
printf(" ");
}
}
}
for(i=0;i<10;i++)
{
SetPos(38,i);
for(j=0;j<10;j++)
{
if(j==0 || j==9)
{
printf("**");
}
else if(i==4 )
{
printf("*");
}
else
{
printf(" ");
}
}
}
for(i=0;i<10;i++)
{
SetPos(52,i);
for(j=0;j<10;j++)
{
if((i==0&& j==7)||(i==9 && j==7))
{
printf("***");
}
else if((i==1 && j==3 ) || (i==8 && j==3))
{
printf("**");
}
else if((i==2 && j==1)||(i==7 && j==1))
{
printf("*");
}
else if(j==0 && i!=0 &&i!=1 && i!=9 && i!=8 && i!=2 && i!=7)
{
printf("*");
}
else
{
printf(" ");
}
}
}
printf("\n");
return 0;
}
第三题是什么意思,解释一下呗 热烈庆祝鱼C五周年嘉年华!!!! 先回下帖来 本帖最后由 hacker.jin 于 2015-1-23 11:31 编辑
百日维新 发表于 2015-1-23 09:11
第三题是什么意思,解释一下呗
看看我的 public static void main(String[] args) {
char[] fishc = {'f','i','s','h','c'};
printString(fishc);
}
public static void printString(char[] toPrint){
// { 0, 1, 2, 3, 4, 5, 6};
// { 7, 8, 9,10,11,12,13};
// {14,15,16,17,18,19,20};
// {21,22,23,24,25,26,27};
// {28,29,30,31,32,33,34};
HashMap charMap = new HashMap();
charMap.put("f",new int[]{0,1,2,3,4,7,14,15,16,17,18,21,28});
charMap.put("i",new int[]{0,1,2,3,4,9,16,23,28,29,30,31,32});
charMap.put("s",new int[]{0,1,2,3,4,7,14,15,16,17,18,25,28,29,30,31,32});
charMap.put("h",new int[]{0,4,7,11,14,15,16,17,18,21,25,28,32});
charMap.put("c",new int[]{0,1,2,3,4,7,14,21,28,29,30,31,32});
String[] fiveRow = new String[]{"","","","",""};
String charArry = "";
for(int num=0; num<toPrint.length; num++){
int[] chr = (int[])charMap.get(String.valueOf(toPrint));
charArry = printChar(chr);
fiveRow += charArry.substring(0, 6);
fiveRow += charArry.substring(7, 13);
fiveRow += charArry.substring(14, 20);
fiveRow += charArry.substring(21, 27);
fiveRow += charArry.substring(28, 34);
}
System.out.println(fiveRow+"\n"+fiveRow+"\n"+fiveRow+"\n"+fiveRow+"\n"+fiveRow);
}
public static String printChar(int[] f){
char[] rowPerChar = " ".toCharArray();//每行7个 5行
for(int i=0; i<f.length; i++){
int tint = f;
rowPerChar='*';
}
return String.valueOf(rowPerChar);
} hacker.jin 发表于 2015-1-23 11:32
看看我的
兄弟,牛逼啊 {:5_106:} trulyzhu 发表于 2015-1-23 12:18
public static void main(String[] args) {
char[] fishc = {'f','i','s','h','c'};
printString(fi ...
这位鱼同学java板块也有活动{:5_108:}
http://bbs.fishc.com/thread-57824-1-1.html 百日维新 发表于 2015-1-23 13:10
这位鱼同学java板块也有活动
http://bbs.fishc.com/thread-57824-1-1.html
{:9_222:} 哇,13楼的好炫酷啊 大家不要急,一星期呢,慢慢来