首页 > 其他分享 >match's mistake-3

match's mistake-3

时间:2023-01-10 19:11:21浏览次数:60  
标签:int cin char 91 tie match mistake

乘法表

https://www.luogu.com.cn/problem/P8723)

小题一道但是得注意几点

1.给定的数据范围不存在第三位数

2.不只是结果大于十的得转化字母乘法中的也要转化(如1010=91 应该写成AA=91);

注意输出的时候是char 不是int等

方法代码如下

char rep[37]={'0','1','2','3','4','5','6','7','8','9',
              'A','B','C','D','E','F','G',
              'H','I','J','K','L','M','N',
              'O','P','Q','R','S','T','U',
              'V','W','X','Y','Z'};
int main() {
    ios::sync_with_stdio(0);
    cin.tie(0), cout.tie(0);
    int n; cin >> n;
    for (int i = 1; i <= n-1; i++) {
        for (int j = 1; j <= i; j++) {
            int s = i*j;
            if(s < n){
                if(j == i)printf("%c*%c=%c\n",rep[i],rep[j],rep[s]);
                else printf("%c*%c=%c ",rep[i],rep[j],rep[s]);
            }
            else{
                int ans = s%n;
                int ss = (s - ans)/n;
                if(j == i)printf("%c*%c=%c%c\n",rep[i],rep[j],rep[ss],rep[ans]);
                else printf("%c*%c=%c%c ",rep[i],rep[j],rep[ss],rep[ans]);
            }
        }
    }
    return 0;
}

标签:int,cin,char,91,tie,match,mistake
From: https://www.cnblogs.com/TFOREVERY/p/17041182.html

相关文章

  • match's mistake-2
    走方格(https://www.luogu.com.cn/problem/P8707)理解一下题目1.行和列都是偶数的时候不能走,问有多少种到达终点的方法看到题目的一瞬间,第一时间想到广搜,结果t了~悲伤~。......
  • match's mistake
    解码(https://www.luogu.com.cn/problem/P8706)题目看起来很简单(实际也很简单)注意几个点就好1.小明很有可能不写1或者写了一个0,所以判断的时候要从0去判断2.所有的例子......
  • dremio FormatMatcher 简单说明
    FormatMatcher核心是对于文件系统进行进行格式匹配,方便查询以及执行引擎了解具体支持的数据格式,进行实际数据的处理每个FormatPlugin都需要包含一个格式化匹配器参考......
  • ERROR 2026 (HY000): SSL connection error: protocol version mismatch
    mysql8安装好连接数据库遇到错误:ERROR2026(HY000):SSLconnectionerror:protocolversionmismatch。错误2026(hy000):SSL连接错误:协议版本不匹配查询ssl配置mysql>s......
  • The first week match's conclusion
    自我声讨(不是这周比赛有难也有易,但是我都是写得很少,摸鱼实在太严重,当然技术不到位也是一个方面,主要还是自己的问题。不再讨论这周比赛学到、用到的的语法如下快读intr......
  • The first week match's mistake-2
    旋转排列(https://www.luogu.com.cn/problem/B3688)解读一下题目:要求从给定的数组拿出最后一个数字后看看变化后的数组的最后一个数字是否是要求的数字想到用栈和队再......
  • The first week match's mistake
    比赛中的补题中的一些错误P8506标题计数(https://www.luogu.com.cn/problem/P8506)第一眼下去,嗯。。贪了,只读到一个‘#’后边跟一个空格就+1,结果wa几个了老老实实一个......
  • VBA查找、匹配函数 Find 、Match
      Range.Find方法(Excel) 表达式.Find (What, After, LookIn, LookAt, SearchOrder, SearchDirection, MatchCase, MatchByte, SearchFormat)特别重要的......
  • 重磅直播|PatchmatchNet:一种高效的Multi-view Stereo框架(CVPR2021)
    本期由苏黎世联邦理工学院ComputerVisionandGeometryGroup王方锦华博士分享,分享的主题为《PatchmatchNet:基于传统PatchMatch算法的高效Multi-viewStereo框架》,主讲人会......
  • git 拉取新分支 error: pathspec ‘develop‘ did not match any file(s) known to gi
     git上有develop分支,branch查看分支看不到develop,checkout切换分支报错一、问题 git上有develop分支,branch查看分支看不到develop,checkout切换分支报错(一)branch查看......