东华复试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年代的之间,计算机科学激烈拓展致力于 开发用于个人计算机的新应用并驱动了计算行业的技术进步**。许多先前已完成的研究开始** 通过个人计算机已经开始面向大众,个人计算机 早期的软件大多源于已有的概念和系统。
相关推荐
暖阳之下10 小时前
学习周报四十五
学习
sealaugh3210 小时前
react native(学习笔记第五课) 英语打卡微应用(4)- frontend的列表展示
笔记·学习·react native
say_fall10 小时前
Git完全入门指南-从概念到实战掌握版本控制的核心
linux·运维·服务器·git·学习
Cloud_Shy61810 小时前
Python 数据分析基础入门:《Excel Python:飞速搞定数据分析与处理》学习笔记系列(第十章 Python 驱动的 Excel 工具 下篇)
笔记·python·学习·数据分析·excel·pandas
Romantic_love_10 小时前
【类和对象 :上篇】
c++·学习
KKei163810 小时前
Flutter for OpenHarmony 学习专注模式APP技术文章
学习·flutter·华为·harmonyos
Odedipus10 小时前
二叉树的学习笔记
数据结构·笔记·学习
sakiko_11 小时前
Swift/UIkit学习笔记27-模块管理,发送位置信息
前端·笔记·学习·ios·swift·uikit
happymaker062611 小时前
Spring学习日记——DAY07(SpringMVC)
java·学习·spring
weixin_4280053011 小时前
C#调用 AI学习从0开始-第1阶段(基础与工具)-第4天CoT思维链学习
开发语言·学习·ai·c#·cot