![](https://img-blog.csdnimg.cn/20201014180756916.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
PTA
PTA 练题
weixin_41894643
这个作者很懒,什么都没留下…
展开
-
PTA 科学计数法 C语言实现
#include <iostream>#include <cstring>static void negative(char arr1[],char arr2[], int address);static void positive(char arr1[], char arr2[],int address);static int char_to_number(char arr[],int index);static bool judge(char arr[],int ind原创 2020-07-05 18:02:26 · 407 阅读 · 0 评论 -
PTA 1018 剪刀石头布
陷阱就是要用getchar()吃掉多余的回车键#include <iostream>int findMax(int *p,int n);int main(void){ int count = 0,index = 0; char player1,player2; int win = 0,failure = 0; int wa[3] = {0,0,0},fa[3] = {0,0,0}; scanf("%d\n",&count); while (index++ <原创 2020-05-20 21:50:02 · 661 阅读 · 0 评论 -
PTA 1017 C语言实现
1000字数太大了,就直接读入字符数组,在进行计算,考虑到个位数的被除数,所以每次取两位进行比较,然后读入数组,在进行输出#include <iostream>#include <cstring>int main(void){ char divisor[10001]; int quotient[10001]; unsigned int dividend; int remainder = 0; scanf("%s %d",divisor,÷nd);原创 2020-05-20 12:20:51 · 301 阅读 · 0 评论 -
PTA 1016 部分A+ B (C语言实现)简单粗暴
主要就是一个数字往字符串转换,不知道为啥ultoa()函数用不了,所以自己写了一个#include <iostream>#include <cstring>#include <cstdio>static int myultoa_(long long n,char str[]);void myultoa(long long n,char str[]);static int i = 0;int main(void){ long long n1,n2; in原创 2020-05-20 10:17:19 · 262 阅读 · 0 评论 -
PTA 1015德才论(C语言实现)
是一种比较呆的想法,算是最笨的一种了思想就是在读入数据的时候就分类存储,然后对每一类进行分类#include <iostream>struct student{ long studentID; int moral; int talent;};struct student class_1[10000];struct student class_2[10000];struct student class_3[10000];struct student class_4[1000原创 2020-05-19 17:11:38 · 354 阅读 · 0 评论