东华复试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年代的之间,计算机科学激烈拓展致力于 开发用于个人计算机的新应用并驱动了计算行业的技术进步**。许多先前已完成的研究开始** 通过个人计算机已经开始面向大众,个人计算机 早期的软件大多源于已有的概念和系统。
相关推荐
Don.TIk21 小时前
SpringCloud学习笔记
笔记·学习·spring cloud
red_redemption1 天前
自由学习记录(131)
学习
Shining05961 天前
推理引擎方向(二)《大模型原理与结构》
人工智能·rnn·深度学习·学习·其他·大模型·infinitensor
WJSKad12351 天前
ECA瓶颈改进YOLOv26通道注意力与残差学习深度融合突破
深度学习·学习·yolo
咕噜咪1 天前
OpenLayers 入门教程:从零开始学习Web地图开发
前端·学习
cd11840511 天前
AutoCAD Electrical 2020学习笔记
笔记·学习
ADHD多动联盟1 天前
当孩子上课小动作多,如何有效改善学习困难?
学习·学习方法·玩游戏
Sarvartha1 天前
递归、回溯与动态规划学习笔记
笔记·学习·动态规划
小光学长1 天前
基于ssm的膳食健康管理系统e6whl4q7(程序+源码+数据库+调试部署+开发环境)带论文文档1万字以上,文末可获取,系统界面在最后面。
java·开发语言·数据库·学习·ssm
weixin_458872611 天前
东华复试OJ二刷复盘7
学习