zoukankan      html  css  js  c++  java
  • 洛谷1421 小玉买文具

    洛谷1421 小玉买文具

    本题地址: http://www.luogu.org/problem/show?pid=1421

    题目描述

    班主任给小玉一个任务,到文具店里买尽量多的签字笔。已知一只签字笔的价格是1元9角,而班主任给小玉的钱是a元b角,小玉想知道,她最多能买多少只签字笔呢。

    输入输出格式

    输入格式:

    输入的数据,在一行内,包括两个整数,依次表示a和b,a<=10000,b<=9。

    输出格式:

    输出一个整数,表示小玉最多能买多少只签字笔。

    输入输出样例

    输入样例#1:

    10 3
    

    输出样例#1:

    5
     1 #include<iostream>
     2 #include<cstdio>
     3 #include<cmath>
     4 #include<algorithm>
     5 #include<stack>
     6 #include<queue>
     7 #include<cstring>
     8 #define PAU putchar(' ')
     9 #define ENT putchar('
    ')
    10 #define MSE(a,b) memset(a,b,sizeof(a))
    11 #define REN(x) for(ted*e=fch[x];e;e=e->nxt)
    12 #define TIL(x) for(int i=1;i<=x;i++)
    13 #define ALL(x) for(int j=1;j<=x;j++)
    14 using namespace std;
    15 inline int read(){
    16     int x=0;bool sig=true;char ch=getchar();
    17     for(;!isdigit(ch);ch=getchar())if(ch=='-')sig=false;
    18     for(;isdigit(ch);ch=getchar())x=10*x+ch-'0';return sig?x:-x;
    19 }
    20 inline void write(int x){
    21     if(x==0){putchar('0');return;}if(x<0)putchar('-'),x=-x;
    22     int len=0;static int buf[20];while(x)buf[len++]=x%10,x/=10;
    23     for(int i=len-1;i>=0;i--)putchar(buf[i]+'0');return;
    24 }
    25 int main(){
    26     double a=read()*10+read();
    27     write(a/19);
    28     return 0;
    29 }
  • 相关阅读:
    Spring框架开发的三种模式
    IDEA 的Surround With快捷键
    Spring框架IOC和AOP的实现原理与详解
    mitmproxy 安装配置
    adb 使用
    小象代理
    requests 模块查看请求的ip地址
    smtplib 邮件模块
    淘宝直播数据爬取 + 淘宝模拟登陆
    postgresql基础操作
  • 原文地址:https://www.cnblogs.com/chxer/p/4750050.html
Copyright © 2011-2022 走看看