鱼C论坛

 找回密码
 立即注册
查看: 12242|回复: 45

[日问] #每日一问# 2016-9-21 (答题领鱼币)

[复制链接]
发表于 2016-9-21 07:00:01 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能^_^

您需要 登录 才可以下载或查看,没有账号?立即注册

x
前言

很多鱼油一来就会问,怎么赚鱼币啊?然后很多鱼油在论坛里面学会了水贴,现在在这里告诉鱼油们哟,水贴被发现是会被扣鱼币和经验的,如果被发现多次是会被禁言的。为了满足各位鱼油们对鱼币的需求,所以我们想出了一个办法,就是每日一问,这样鱼油就能够在了解论坛的时候,还能够赚点鱼币。


规则

1:每日一问这个活动会一直持续持续下去。
2:人工审核。每个天每个问题1-5个鱼币。
3:内容不定,技术知识,论坛规则等等


今日题目

用你会的编程语言写一个小程序



本帖被以下淘专辑推荐:

小甲鱼最新课程 -> https://ilovefishc.com
回复

使用道具 举报

发表于 2020-5-10 14:49:51 | 显示全部楼层
@echo off
set string="为什么叫小甲鱼呀"
echo %string%
小甲鱼最新课程 -> https://ilovefishc.com
回复 支持 反对

使用道具 举报

发表于 2020-5-9 19:44:50 | 显示全部楼层
import random
scel = random.randint(1,100)
print("-------------猜数字------------")
temt=input("请输入1到100以内的值:")
num=int(temt)
while num != scel:
    temt=input("输错了,请重新输入吧:")
    num=int(temt)
    if num == scel:
        print("你也太聪明了")
        print("猜中也没奖励")
    else:
        if 1<= num < scel:
            print("小了,小了")
        else:
            if scel < num <= 100:
                print("大了,大了!!")
            else:
                print("超出1到100数字范围了")
print('好了,游戏结束!')
小甲鱼最新课程 -> https://ilovefishc.com
回复 支持 反对

使用道具 举报

发表于 2020-3-23 16:57:47 | 显示全部楼层
>>> print("80*365*24*60*60")
80*365*24*60*60
>>> print(80*365*24*60*60)
2522880000
>>> 我是不是特别笨
小甲鱼最新课程 -> https://ilovefishc.com
回复 支持 反对

使用道具 举报

发表于 2020-3-21 10:09:07 From FishC Mobile | 显示全部楼层
def earnest(a,b,c):
        x1 = +((b**2)/((2*a)**2) - c/a)**(1/2) - b/(2*a)
        x2 = -((b**2)/((2*a)**2) - c/a)**(1/2) - b/(2*a)
        return x1,x2
print(earnest(1,6,-7))
a = int(input('请输入a:'))
b = int(input('请输入b:'))
c = int(input('请输入c:'))
temp = earnest(a,b,c,)
print(temp)
小甲鱼最新课程 -> https://ilovefishc.com
回复 支持 反对

使用道具 举报

发表于 2020-3-21 00:51:17 | 显示全部楼层
  1. print("来和我玩一个猜数字游戏吧!")
  2. print("来猜猜现在我想的数字是几,1~10之间。")
  3. temp = input("请输入你的答案 ")
  4. answer = 3
  5. number = 3
  6. while number:
  7.     if temp ==answer:
  8.         print("You are so clever!")
  9.         break
  10.     print("That's not what I thought! ")
  11.     print("You will have",number-1,"chances!")
  12.     i = input("Try again!")
  13.     number -=1
复制代码
小甲鱼最新课程 -> https://ilovefishc.com
回复 支持 反对

使用道具 举报

发表于 2020-3-19 23:05:34 | 显示全部楼层
新手,还有很多不会
  1. #include <stdio.h>

  2. void main()
  3. {
  4.     int i, j, result;
  5.     for (i = 1; i <= 9; i++)
  6.     {
  7.         for (j = 1; j <= i; j++)
  8.         {
  9.             printf("%d*%d=%-2d ", j, i, i * j);
  10.         }
  11.         putchar('\n');
  12.     }

  13.     return 0;
  14. }
复制代码
小甲鱼最新课程 -> https://ilovefishc.com
回复 支持 反对

使用道具 举报

发表于 2020-3-17 20:33:08 | 显示全部楼层
import random
secret = random.randint(1,10)
print('········我爱宝宝········')
temp = input("不妨猜一下我现在心里面想的是哪个数字:")
n = 1
guess = int(temp)
while guess !=secret and n<3:
    temp = input("哎呀,猜错了,请重新输入吧:")
    n=n+1
    guess = int(temp)
    if guess == secret:
        print("宝宝真聪明")
        print("奖励宝宝一个亲亲")
    else:
        if guess > secret:
            print("宝宝,大了大了~~")
        else:
            print("嘿,小了!小了!!")
print("游戏结束,不玩啦^_^")
嘿嘿,第4讲之后完成的
小甲鱼最新课程 -> https://ilovefishc.com
回复 支持 反对

使用道具 举报

发表于 2020-2-27 16:09:51 | 显示全部楼层
def feber(n):
    if n<=2:
        return 1
    else:
        return feber(n-2)+feber(n-1)
小甲鱼最新课程 -> https://ilovefishc.com
回复 支持 反对

使用道具 举报

发表于 2020-2-26 11:40:21 | 显示全部楼层
#include<stdio.h>

int main()
{
printf("hello world!");
return 0;
}
刚开始学
小甲鱼最新课程 -> https://ilovefishc.com
回复 支持 反对

使用道具 举报

发表于 2020-2-26 11:34:36 | 显示全部楼层
from easygui import *
import pickle
persondict = {}
f = open('C:\\little jiayu Python study\\我的练习\\persondict.txt','wb')
pickle.dump(persondict,f)
f.close()
pkl_file = open('C:\\little jiayu Python study\\我的练习\\persondict.txt','rb')
persondict = pickle.load(pkl_file)
pkl_file.close()
cheese = ['*用户名','*生日','电话号码','爱好','*用户密码']
cheese2 = ['用户名','生日','电话号码','爱好','用户密码']
list2 = []
msgbox('欢迎使用个人信息程序','个人信息程序')
while 1:
    choose = buttonbox('请选择您需要的服务','个人信息程序',choices = ('添加个人信息','查询个人信息','退出程序'))
    if choose == '添加个人信息':
        while 1:
            msgbox('好的,即将进入编辑界面...','个人信息程序')
            list1 = list(multpasswordbox('用户信息编辑界面[带*的为必填项]','个人信息程序',cheese))
            if list1[0] == '' or list1[1] == '' or list1[4] == '':
                msgbox('必填项未填写完整!','个人信息程序',ok_button = '返回,重新填写')
                continue
            else:
                break
        persondict = {list1[0]:list1[1:]}
        msgbox('保存成功!','个人信息程序')
        f = open('C:\\little jiayu Python study\\我的练习\\persondict.txt','wb')
        pickle.dump(persondict,f)
        f.close()
        continue
    elif choose == '查询个人信息':
        while 1:
            find = enterbox('请输入需要查找的用户名:','个人信息程序')
            try:
                fined = persondict[find]
            except KeyError:
                msgbox('查找的用户不存在!','个人信息程序',ok_button = '返回,重新查找')
                continue
            msgbox('好的,即将显示用户资料...','个人信息程序')
            msgbox('查询结果:' + '\n用户名:' + find + '\n生日:' + fined[0] + '\n电话号码:' + fined[1] + '\n爱好:' + fined[2] + '\n密码:' + fined[3],'个人信息程序')
        continue
    else:
        msgbox('好的,即将退出程序...','个人信息程序')
        break
小甲鱼最新课程 -> https://ilovefishc.com
回复 支持 反对

使用道具 举报

发表于 2020-2-26 10:48:08 | 显示全部楼层
  1. #include<stdio.h>
  2. int main()
  3. {
  4.     printf("hello world!");
  5.     return 0;
  6. }
复制代码

这是我接触的第一个程序,C语言赛高!!!!!
小甲鱼最新课程 -> https://ilovefishc.com
回复 支持 反对

使用道具 举报

发表于 2020-2-25 11:51:54 | 显示全部楼层
while 1 > 0:
    b = int(input("请写入你的颜值:"))

    if b > 100:
        print('别做梦了,你这个丑八怪!')
        break
        
    elif b > 95:
        print('倾国倾城')
    elif:
        if b > 80:
            print('美女')
      elif:
          if b > 60:
              print('还可以')
       else:
           print('路人甲')
小甲鱼最新课程 -> https://ilovefishc.com
回复 支持 反对

使用道具 举报

发表于 2020-2-19 13:04:48 | 显示全部楼层
print ("hello,我是你的小计算机\n请在下方>>>处输入计算题来考考我吧!")
小甲鱼最新课程 -> https://ilovefishc.com
回复 支持 反对

使用道具 举报

发表于 2020-2-17 21:59:34 | 显示全部楼层
zifu=input("猜一猜正确的数字是什么:")
cai=int(zifu)
while cai != 8:
    zifu=input("again:")
    cai=int(zifu)
    if cai==8:
        print("你答对了")
        print("非常好")
    else:
        if cai >8:
            print('大了')
        else:
            print('小了')
   
print("结束了")



这个是看了视频后 自己写的。新手见谅。
小甲鱼最新课程 -> https://ilovefishc.com
回复 支持 反对

使用道具 举报

发表于 2020-2-4 18:00:36 | 显示全部楼层
#include <stdio.h>

#define URL "http://www.fishc.com"
#define NAME "鱼C工作室"
#define BOSS "小甲鱼"
#define YEAR 2010
#define MONTH 5
#define DAY 20

int main()
{
        printf("%s成立于%d年%d月%d日\n",NAME,YEAR,MONTH,DAY);
        printf("%s是%s创立的...嘻嘻嘻,有点不好意思了\n",NAME,BOSS);
        printf("%s的域名是%s\n",NAME,URL);       
       
        return 0;
}

小甲鱼最新课程 -> https://ilovefishc.com
回复 支持 反对

使用道具 举报

发表于 2020-1-31 11:39:06 | 显示全部楼层
#include <stdbool.h>
#include <stdio.h>
int main(void)
{
    bool digit_seen[10] = { false };
    int a[10] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 };
    int b[10] = { 0 };
    int i;
    int digit;
    long n;
    printf("Enter a number: ");
    scanf("%ld", &n);
    while (n > 0) {
        digit = n % 10;
        n /= 10;
        b[digit]++;
    }
    printf("digit:      ");
    for (i = 0; i < 10; i++)
        printf("%2d", a[i]);
    printf("\n");
    printf("Occurrences;");
    for (i = 0; i < 10; i++)
        printf("%2d", b[i]);

    return 0;
小甲鱼最新课程 -> https://ilovefishc.com
回复 支持 反对

使用道具 举报

发表于 2020-1-25 17:56:25 | 显示全部楼层
while '无限'
    成功一水
小甲鱼最新课程 -> https://ilovefishc.com
回复 支持 反对

使用道具 举报

发表于 2016-9-23 14:58:43 | 显示全部楼层
clear=list()
srect=list()
Da=['A','B','C','D','E','F','G','H','I','J','K','M','L','N','O','P','Q','R','S','T','U','V','W','X','Y','Z']
Xa=['a','b','c','d','e','f','g','h','i','j','k','m','l','n','o','p','q','r','s','t','u','v','w','x','y','z']
i=0

clear=list(input("请输入明文:"))
i=0
for i in range(len(clear)):
    if  clear[i]>='a' and clear[i]<='z':
        x=Xa.index(clear[i])
        srect.append(Xa[25-x])
    if  clear[i]>='A' and clear[i]<='Z':
        x=Da.index(clear[i])
        srect.append(Da[25-x])
    else:
        srect.append(clear[i])
    i+=1
i=0
while i<len(srect):
    print(srect[i],end='')
    i+=1

两月之前做的题,不知道是哪的题,解密的
小甲鱼最新课程 -> https://ilovefishc.com
回复 支持 反对

使用道具 举报

发表于 2016-9-22 00:10:17 | 显示全部楼层
temp = input('请输入一个数字计算它的阶乘')
while True:
    if temp.isdigit():
        number = int(temp)
        while True:
            a = 1
            for i in range(number):
                product = a*(i+1)
                a = product
            print(product)
            temp = input()
            if temp.isdigit():
                number = int(temp)
            else:
                temp = input('输入有误,请重新输入')
    else:
        temp = input('输入有误,请重新输入')
        
小甲鱼最新课程 -> https://ilovefishc.com
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

小黑屋|手机版|Archiver|鱼C工作室 ( 粤ICP备18085999号-1 | 粤公网安备 44051102000585号)

GMT+8, 2025-9-22 06:25

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表