2062:【例1.3】电影票 题解

题目链接

题目描述

已知一位小朋友的电影票价是\(10\)元,计算\(x\)位小朋友的总票价是多少?

解题思路

简单的数学题,没什么好说的。
人数是输入的\(x\),电影票总价是\(10x\)元。

AC Code

#include<bits/stdc++.h>
using namespace std;
int main()
{
    ios::sync_with_stdio(0),cin.tie(nullptr),cout.tie(nullptr);
    int x;
    cin>>x;
    cout<<x<<" "<<x*10;
    return 0;
}
posted @ 2024-07-19 11:49  Firra3500  阅读(11)  评论(0编辑  收藏  举报