东华复试OJ每日3题打卡·复盘97~99

基础97::给你一个整数(十进制),判断该整数的十进制数和它的二进制数是否全为回文数。

cpp 复制代码
#include <stdio.h>
#include <stdlib.h>

int main(){
    int n;
    while(scanf("%d",&n) != EOF){
        getchar();
        
        //1.测试十进制
        int tempNum=0;
        for(int temp = n;temp>0;temp/=10){
            tempNum = tempNum*10+temp%10;
        }
        
        if(tempNum != n){
        	printf("No\n");continue;
		}
		
		//2.测试二进制
		int numA[20]={0};

		int len=0;
		int yes=1;
		for(int temp = n;temp>0;len++,temp/=2){
            numA[len] = temp%2;
            //printf("%d", temp%2);
        }
        for(int i=0;i<len/2;i++){
        	if(numA[i] != numA[len-1-i]){
        		printf("No\n");
        		yes=0;
        		break;
			}
		}
        if(yes)	printf("Yes\n");
        
    }
    
    
    
    
}

基础98:给你一串正整数的连加表达式,完成这个表达式的计算。

cpp 复制代码
#include <stdio.h>
#include <stdlib.h>
#include <string.h>


int main(){
    char Hang[1001];
    while ( fgets(Hang,sizeof(Hang),stdin) ){//1. 获取输入
        //2.0 辅助变量
        int sum=0;
        int num=0;//获取每个数字
        int len = strlen(Hang);
        //2.遍历数组
        for(int i=0;i<len;i++){
            if(Hang[i] == '\n' || Hang[i] == '\0'){
            	break;
			}
            if(Hang[i] == '+' ){
                sum+=num;
                num=0;
            }
            else{
                num = num*10 + (Hang[i] - '0');
            }
            
        }//遍历数组
        sum+=num;
        printf("%d\n",sum);
        
    }
    
}
  • 测试文件的输入数据每一行不一定有终止符或换行符,因此不能以此为边界

基础99:

1) 第1轮,写出两个1,即11;

2) 第2轮,在它们中间插入2,成为121;

3) 第3轮,在上面数中每两个相邻的和为3的数之间插入3,成为13231;

4) 以此类推下去,第n轮,在第n-1轮的数字的基础上,每两个相邻的和为n的数之间插入n。

根据题目描述中所描述的序列产生规则构造序列的前9项,然后告诉你一个正整数n,要求你输出序列的第n项。

cpp 复制代码
#include <stdio.h>
#include <stdlib.h>


int main(){
    int n;
    while(scanf("%d",&n) != EOF){
        //0.初始辅助变量
        int ans[30];//初值
        ans[0] = 1;
        ans[1] = 1;
        int len=2;
        int count=1;
        while(count < n){
            count++;
            
            for(int i=0;i<len;i++){
                if(i+1 < len && ans[i] + ans[i+1] ==count){
                    //符合条件时,插入
                    len++;
                    //移动i+1起始的后续数字
                    for(int j=len-1;j>i+1;j--){
                        ans[j] = ans[j-1];
                    }
                    ans[i+1]=count;
                }
            }//遍历
        }//循环count
        for(int i=0;i<len;i++){
            printf("%d",ans[i]);
        }
        printf("\n");
        
    }
    
    
}

Early work in the field of computer science during the late 1940s and early 1950s focused on automating the process of making calculations for use in science and engineering. Scientists and engineers developed theoretical models of computation that enabled them to analyze how efficient different approaches were in performing various calculations. Computer science overlapped considerably during this time with the branch of mathematics known as numerical analysis, which examines the accuracy and precision of calculations.

  • 从20世纪40年代末到50年代期间的计算机科学领域的早期工作聚焦于自动化计算过程用于科学和工程学。科学家和工程师开发计算的理论模型使得他们能分析在执行各种计算中的不同方法的效率。在这一时期计算机科学与数值分析有相当大的重叠,这是一个检验计算的精确性和准确性的数学分支。

As the use of computers expanded between the 1950s and the 1970s, the focus of computer science broadened to include simplifying the use of computers through programming languages------artificial languages used to program computers, and operating systems------computer programs that provide a useful interface between a computer and a user. During this time, computer scientists were also experimenting with new applications and computer designs, creating the first computer networks, and exploring relationships between computation and thought.

  • 随着 计算机的使用在20世纪50年代和70年代的扩展,计算机科学的关注拓展到 通过编程语言来简化计算机的使用------人类语言用于对计算机的编程**,而** 操作系统编程------计算机程序提供有效计算机与使用者之间的界面 。在这一时期,计算机科学家也实验新的应用程序和计算机设计,并创造首批 计算机网络和探索计算与思维之间的关系。

In the 1970s, computer chip manufacturers began to mass-produce microprocessors------the electronic circuitry that serves as the main information processing center in a computer. This new technology revolutionized the computer industry by dramatically reducing the cost of building computers and greatly increasing their processing speed. The microprocessor made possible the advent of the personal computer, which resulted in an explosion in the use of computer applications. Between the early 1970s and 1980s, computer science rapidly expanded in an effort to develop new applications for personal computers and to drive the technological advances in the computing industry. Much of the earlier research that had been done began to reach the public through personal computers, which derived most of their early software from existing concepts and systems.

  • reach the public 面向大众
  • 在20世纪70年代,计算机芯片制造商开始大规模生产微型处理器------一种电子电路在计算机中担任主要的信息处理中心。这一全新技术改革了计算机行业通过极大地减少生产计算机的成本和极大地提高了计算机的运行速度。微型处理器使得个人计算机的问世成为可能并引发 了计算机应用程序的使用大爆发。在20世纪的70年代与80年代的之间,计算机科学激烈拓展致力于 开发用于个人计算机的新应用并驱动了计算行业的技术进步**。许多先前已完成的研究开始** 通过个人计算机已经开始面向大众,个人计算机 早期的软件大多源于已有的概念和系统。
相关推荐
nashane14 分钟前
HarmonyOS 6学习:JsCrash“闪退”法医指南——从FaultLog堆栈还原崩溃现场的终极手册
学习·华为·harmonyos
for_ever_love__16 分钟前
UI学习:UICollectionView瀑布流
学习·ui·ios·objective-c·cocoa
AOwhisky34 分钟前
MySQL 学习笔记(第六期):MySQL 备份与恢复
运维·数据库·笔记·学习·mysql·云计算
_李小白1 小时前
【android opencv学习笔记】Day 32:直线检测之霍夫变换
android·opencv·学习
提子拌饭1332 小时前
Column 嵌套布局:多级 Column 实现复杂纵向结构——鸿蒙 HarmonyOS ArkTS 原生学习应用
学习·华为·harmonyos·鸿蒙·鸿蒙系统
xqqxqxxq3 小时前
树结构技术学习笔记
数据结构·笔记·学习
十月的皮皮4 小时前
C语言学习笔记202606008- 三角形判断(3种方法)
c语言·笔记·学习
XGeFei4 小时前
【Fastapi学习笔记(6)】—— Fastapi文件上传、请求头自动转换
笔记·学习·fastapi
一口吃俩胖子4 小时前
【脉宽调制DCDC功率变换学习笔记024】频域性能
笔记·学习
吃着火锅x唱着歌4 小时前
深度探索C++对象模型 学习笔记 第五章 构造、解构、拷贝语意学(2)
c++·笔记·学习