东华复试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年代的之间,计算机科学激烈拓展致力于 开发用于个人计算机的新应用并驱动了计算行业的技术进步**。许多先前已完成的研究开始** 通过个人计算机已经开始面向大众,个人计算机 早期的软件大多源于已有的概念和系统。
相关推荐
你怎么知道我是队长2 小时前
前端学习---HTML---第一个HTML程序
学习
楼田莉子2 小时前
CMake学习:CMake在二进制工程场景上应用
linux·c++·vscode·学习·软件构建
知识分享小能手2 小时前
SQL Server 2019入门学习教程,从入门到精通,SQL Server 2019 新增功能 — 语法知识点及使用方法详解(20)
数据库·学习·sqlserver
2501_944934732 小时前
高职金融大数据应用专业,怎么学习金融数据建模基础?
大数据·学习·金融
nix.gnehc2 小时前
Go进阶攻坚+专家深耕级学习清单|聚焦高并发、高性能中间件/底层框架开发(Java开发者专属)
学习·中间件·golang
apcipot_rain2 小时前
python 多进程多线程 学习笔记
笔记·python·学习
学编程的闹钟2 小时前
E语言变量声明与使用全解析
学习
你怎么知道我是队长2 小时前
前端学习---VsCode相关插件安装
前端·vscode·学习
宇木灵11 小时前
C语言基础-十、文件操作
c语言·开发语言·学习