输入姓名并分别输出姓和名

C++ DAY3 一.抄 二.做 1.输入名字将名和姓输出顺序改变 #include <stdio.h> int main() { char firstname[20],lastname[20]; printf("Please enter your firstname."); scanf("%19s",firstname); printf("Please enter you lastname."); scanf("%19s,",lastname); printf("Hello!%s,%s. 阅读详情

输入姓名并分别输出姓和名

/**
 * InputAndOutputName.java
 * 输入姓名并分别输出姓和名
 * 
@author 邓超
 * 
@version 0.1 2008/5/11
 * 开发/测试环境:jdk1.6 + eclipse SDK 3.3.2
 
*/


import java.util.Scanner;

public class InputAndOutputName {
    
    
public static void main(String[] args) {
        
        Scanner input 
= new Scanner(System.in);

        
//保存我国现存的81个复姓(如果还有人是其他复姓,我估计这人是刚出土的)
        String[] RepeatedFamilyName = new String[]{"欧阳","太史",
        
"端木","上官","司马","东方","独孤","南宫","万俟","闻人","夏侯",
        
"诸葛","尉迟","公羊","赫连","澹台","皇甫","宗政","濮阳","公冶",
        
"太叔","申屠","公孙","慕容","仲孙","钟离","长孙","宇文","司徒",
        
"鲜于","司空","闾丘","子车","亓官","司寇","巫马","公西","颛孙",
        
"壤驷","公良","漆雕","乐正","宰父","谷梁","拓跋","夹谷","轩辕",
        
"令狐","段干","百里","呼延","东郭","南门","羊舌","微生","公户",
        
"公玉","公仪","梁丘","公仲","公上","公门","公山","公坚","左丘",
        
"公伯","西门","公祖","第五","公乘","贯丘","公皙","南荣","东里",
        
"东宫","仲长","子书","子桑","即墨","达奚","褚师"}
;
        
//System.out.println("我国现存复姓数量为:" + RepeatedFamilyName.length + "个。");
        
//保存全名
        String fullName;
        
//保存姓氏
        String familyName = "";
        
//保存名字
        String firstName = "";
        
//循环标识
        boolean con;
        
        
do {
            con 
= false;
            
//控制台输入提示
            System.out.print("输入任意一个姓名:");
            
//接收并保存全名
            fullName = input.next();
            
//保存输入内容的前两个字符
            String frontTwoChar = fullName.substring(0, 2);
            
            
//处理复姓
            for (int i = 0; i < RepeatedFamilyName.length; i++) {

                
if (RepeatedFamilyName[i].equals(frontTwoChar)) {
        
                    
if (fullName.length() <= 2 &&                //姓氏不为“欧阳”,且完整姓名小于等于两个字符的
                        !frontTwoChar.equals("欧阳")) {
                        System.out.println(
"错误,请输入完整姓名!");
                        con 
= true;
                    }
 else if (fullName.length() > 2 &&          //姓氏不为“欧阳”,且完整姓名大于两个字符的
                        !frontTwoChar.equals("欧阳")) {
                        familyName 
= fullName.substring(0, 2);
                        firstName 
= fullName.substring(2);
                    }
 else if (fullName.length() <= 2 &&         //姓氏是“欧阳”,且完整姓名小于等于两个字符的
                        frontTwoChar.equals("欧阳")) {
                        familyName 
= fullName.substring(0, 1);
                        firstName 
= fullName.substring(1);
                    }
 else if (fullName.length() > 2 &&          //姓氏是“欧阳”,且完整姓名大于两个字符的
                        frontTwoChar.equals("欧阳")) {
                        familyName 
= fullName.substring(0, 2);
                        firstName 
= fullName.substring(2);
                    }

                    
//找到相匹配的复姓就跳出循环,停止判断
                    break;
                }
 else {
                    familyName 
= fullName.substring(0, 1);
                    firstName 
= fullName.substring(1);
                }

            }

            
            
//控制台分别输出姓和名
            System.out.println("姓氏:" + familyName);
            System.out.println(
"名字:" + firstName);
            
            
//询问用户是否中止程序
            System.out.print("是否继续(y/n)?");
            
char choose = input.next().charAt(0);
            
if (choose == 'y' || choose == 'Y') {
                con 
= true;
            }

        }
 while (con);        
        
//退出
        System.exit(0);
    }

}
编写一个程序,它要求用户首先输入其名,然后输入其姓;然后程序使用一个逗号和空格将姓和名组合起来,并存储和显示组合结果。请使用char数组和头文件cstring中的函数。 题目需求:编写一个程序,它要求用户首先输入其名,再输入其姓。然后程序使用一个逗号和空格组合起来,并存储和显示组合结果。请使用char数组和头文件cstring 中的函数,下面是该程序运行的情况: Enter your first name:Flip Enter your last nae:Fleming Here’s the information in a single string:Fleming,Flip 显然,本题的知识点是字符串的输入输出与数组和cstring. #include<iostr 阅读详情

相关推荐

从键盘上输入10名学生的姓名及三科考试成绩和总成绩,排序并输出(c语言结构体)

编写程序:从键盘上输入10名学生的姓名及三科考试成绩和总成绩,排序并输出。 具体要求: ① 使用结构体数组实现。 ② 用户自定义函数输入学生的信息和输出结果; ③ 自定义函数排序 ④ 在main函数中调用这些函数 #include<stdio.h> int i,j; #define N 10 struct stu{ char name[5]; int sco[3]; int su...

qq_45151541的博客 1万+

JAVA 输入名称,输出相对应的编号

1、输入名称,输出相对应的编号 import com.zh.mc.MobileController.walletPay.GetBank; public class Text { public static void main(String[] args) { String code = getname("香蕉"); System.out.println(code); } p...

夜雪天曦的博客 2735

Android 关于佳博和汉印蓝牙热敏打印机开发,Android程序员必经的实践之路

针对于上面的问题,我总结出了互联网公司Android程序员面试涉及到的绝大部分面试题及答案,并整理做成了文档,以及系统的进阶学习视频资料。(包括Java在Android开发中应用、APP框架知识体系、高级UI、全方位性能调优,NDK开发,音视频技术,人工智能技术,跨平台技术等技术资料),希望能帮助到你面试前的复习,且找到一个好的工作,也节省大家在网上搜索资料的时间来学习。《互联网大厂面试真题解析、进阶开发核心学习笔记、全套讲解视频、实战项目源码讲义》点击传送门即可获取!

2401_84149570的博客 1021

Java拆分为姓和名

这里写自定义目录标题欢迎使用Markdown编辑器新的改变功能快捷键合理的创建标题,有助于目录的生成如何改变文本的样式插入链接与图片如何插入一段漂亮的代码片生成一个适合你的列表创建一个表格设定内容居中、居左、居右SmartyPants创建一个自定义列表如何创建一个注脚注释也是必不可少的KaTeX数学公式新的甘特图功能,丰富你的文章UML 图表FLowchart流程图导出与导入导出导入 欢迎使用Markdown编辑器 你好! 这是你第一次使用 Markdown编辑器 所展示的欢迎页。如果你想学习如何使用Mar

LGJmutou的博客 1394

软件测试--用例篇(测试用例的好处、测试用例的七种设计方法、测试用例的粒度、测试用例的评价)

作为软件测试工程师,最主要的工作就是:编写测试用例,那么为什么要编写测试用例?它有什么好处?如何编写测试用例?测试用例写简单好还是复杂好?如何评价测试用例的质量? 天呐撸!能说不会吗?! 作为倾向软件测试工程师的老铁们,还是一起来学习吧! 一、编写测试用例的好处 测试用例是测试者的依据 测试用例使得工作可重复,是自动化测试的基础 补充:自动化测试的前提条件是:功能比较稳定,页面...

cherrydreamsover的博客 3734

树莓派4B安装 ubuntu20.04 & VNC远程桌面 & 安装ROS noetic

树莓派4B安装ubuntu20.04 & VNC远程桌面1、安装ubuntu方式1:下载Imager文件。方式2:下载镜像文件。2、查询树莓派 IP 地址3、使用ssh远程登录树莓派4、更新源地址5、更新6、安装桌面环境7、允许root登陆8、登陆远程桌面9、设置中文 1、安装ubuntu 方式1:下载Imager文件。...

weixin_44415639的博客 2万+

Java中文姓名拆分

实现逻辑比较简单,就是通过姓氏匹配来完成。优先匹配复姓,不满足是均按照单姓处理。这样处理依旧会存在问题,复姓姓氏不全、少数民族特殊姓氏没有匹配上的话都会按照单姓处理,所以还是需要不断完善。...

u014295903的博客 1961

雷达系统仿真——非相参累积和相参累积检测

非相参累积和相参累积检测 在雷达回波检测中,在特殊情况下,才会根据单个脉冲来进行检测判决。通常,雷达会从每个目标接收几个到几百个成串脉冲,在做出判决之前,要先对脉冲串进行处理。对脉冲串进行处理的方法有5种: 相参累积(Coherent Integration); 非相参累积(Nocoherent Integration); 二进制累积; 累计检测; 反馈累积器。 1 非相参累积 也叫“检波后累积”,或者“视频累积”(Video Integration),比检波前累积更容易完成,因为不需要保存回波的相位。

little_soldier的专栏 1万+

java 实现输出姓和名

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 package xiaojie; import java.util.Scanner; public class baiJiaXing { public static void main(String[] args...

weixin_34236497的博客 726

保姆级教程:用Labelme标注车辆关键点,并一键转成YOLOv8-pose训练格式

本文提供了一份详细的车辆底盘关键点标注教程,从使用Labelme进行标注到一键转换为YOLOv8-pose训练格式的全流程指南。特别针对工业检测和自动驾驶场景,分享了标注规范、格式转换脚本及常见问题解决方案,帮助开发者高效准备训练数据并优化模型性能。

weixin_27419879的博客 306

Pintos project 1 实验报告(代码分享)

任务一 Alarm Clock 用到的相干目录有: pintos/src/devices time.h && time.c pintos/src/threads thread.h && thread.c 预期pass希望:暂无,安装pintos之后,第一次对threads进行make check操作,可以发现以alarm--开头的前六个文件,以及mlfqs-fair-2和mlfqs-fair-20文件,一开始就测试成功pass。但是为了避免对后期的修改有影响,这里还是要

m0_53112875的博客 6860

java的输入输出

java中的输入和输出

m0_73274780的博客 1938

足式机器人全身 MPPI: 利用 MPPI 对足式机器人进行实时全身控制

本研究首次在真实四足机器人上成功部署了基于全身采样的模型预测控制(MPC)系统。采用模型预测路径积分(MPPI)算法,通过并行采样和评估控制轨迹实现实时运动规划。该系统能处理复杂接触场景,完成推箱子、爬越障碍及崎岖地形行走等任务。实验使用Unitree Go1机器人,结合MuJoCo仿真器快速生成运动策略,仅需简单控制策略即可实现稳健操作。硬件验证表明,该方法能有效完成目标导向的箱子推动任务。该成果标志着采样MPC在足式机器人实际应用中的重要突破。

2506_90492529的博客 999

输入姓名,问好,字符切片 (10 分)

从键盘输入姓名,对姓和名切片,然后输出 输入格式: 从键盘输入姓名, 输出格式: 你好,**同学。 *同学,很高兴认识你。 *同学,我们交个朋友吧! 输入样例: 在这里给出一组输入。例如: 黄小燕 #结尾无空行 输出样例: 在这里给出相应的输出。例如: 你好,黄小燕同学。 黄同学,很高兴认识你。 小燕同学,我们交个朋友吧! #结尾无空行 代码: #有复姓的咋办?欧阳、太史、端木、上官、司马、东方、独孤、南宫、万俟、闻人、夏侯、诸葛、尉迟、公羊、赫连、澹台、皇甫、宗政、濮阳、公冶等 def count

优快云_YJX的博客 4084

全功能tgbot/Telegram机器人多功能有后台版源码

trx兑换 闪兑 关键字监控 群管 usdt监控 余额查询 推广分享 等几乎常见的tg机器人功能都有。全功能tgbot/telegram机器人多功能有后台版源码-打包好的可以直接上手。

百创科技 2698

深度学习工具包 DeepLearningToolbox

深度学习工具包Deprecation notice.-----This toolbox is outdated and no longer maintained.There are much better tools available for deep learning than this toolbox, e.g. [Theano](http://deeplearning.net/software/theano/), [torch](http://torch.ch/) or [tensorflow](http://www.tensorflow.org/)I would suggest you use one of the tools mentioned above rather than use this toolbox.Best, Rasmus.DeepLearnToolbox================A Matlab toolbox for Deep Learning.Deep Learning is a new subfield of machine learning that focuses on learning deep hierarchical models of data.It is inspired by the human brain's apparent deep (layered, hierarchical) architecture.A good overview of the theory of Deep Learning theory is[Learning Deep Architectures for AI](http://www.iro.umontreal.ca/~bengioy/papers/ftml_book.pdf)For a more informal introduction, see the following videos by Geoffrey Hinton and Andrew Ng.* [The Next Generation of Neural Networks](http://www.youtube.com/watch?v=AyzOUbkUf3M) (Hinton, 2007)* [Recent Developments in Deep Learning](http://www.youtube.com/watch?v=VdIURAu1-aU) (Hinton, 2010)* [Unsupervised Feature Learning and Deep Learning](http://www.youtube.com/watch?v=ZmNOAtZIgIk) (Ng, 2011)If you use this toolbox in your research please cite [Prediction as a candidate for learning deep hierarchical models of data](http://www2.imm.dtu.dk/pubdb/views/publication_details.php?id=6284)```@MASTERSTHESIS\{IMM2012-06284, author = "R. B. Palm", title = "Prediction as a candidate for learning deep hierarchical models of data", year = "2012",}```Contact: rasmusbergpalm at gmail dot comDirectories included in the toolbox-----------------------------------`NN/` - A library for Feedforward Backpropagation Neural Networks`CNN/` - A library for Convolutional Neural Networks`DBN/` - A library for Deep Belief Networks`SAE/` - A library for Stacked Auto-Encoders`CAE/` - A library for Convolutional Auto-Encoders`util/` - Utility functions used by the libraries`data/` - Data used by the examples`tests/` - unit tests to verify toolbox is workingFor references on each library check REFS.mdSetup-----1. Download.2. addpath(genpath('DeepLearnToolbox'));Example: Deep Belief Network---------------------```matlabfunction test_example_DBNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit RBM and visualize its weightsrand('state',0)dbn.sizes = [100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);figure; visualize(dbn.rbm{1}.W'); % Visualize the RBM weights%% ex2 train a 100-100 hidden unit DBN and use its weights to initialize a NNrand('state',0)%train dbndbn.sizes = [100 100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);%unfold dbn to nnnn = dbnunfoldtonn(dbn, 10);nn.activation_function = 'sigm';%train nnopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.10, 'Too big error');```Example: Stacked Auto-Encoders---------------------```matlabfunction test_example_SAEload mnist_uint8;train_x = double(train_x)/255;test_x = double(test_x)/255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit SDAE and use it to initialize a FFNN% Setup and train a stacked denoising autoencoder (SDAE)rand('state',0)sae = saesetup([784 100]);sae.ae{1}.activation_function = 'sigm';sae.ae{1}.learningRate = 1;sae.ae{1}.inputZeroMaskedFraction = 0.5;opts.numepochs = 1;opts.batchsize = 100;sae = saetrain(sae, train_x, opts);visualize(sae.ae{1}.W{1}(:,2:end)')% Use the SDAE to initialize a FFNNnn = nnsetup([784 100 10]);nn.activation_function = 'sigm';nn.learningRate = 1;nn.W{1} = sae.ae{1}.W{1};% Train the FFNNopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.16, 'Too big error');```Example: Convolutional Neural Nets---------------------```matlabfunction test_example_CNNload mnist_uint8;train_x = double(reshape(train_x',28,28,60000))/255;test_x = double(reshape(test_x',28,28,10000))/255;train_y = double(train_y');test_y = double(test_y');%% ex1 Train a 6c-2s-12c-2s Convolutional neural network %will run 1 epoch in about 200 second and get around 11% error. %With 100 epochs you'll get around 1.2% errorrand('state',0)cnn.layers = { struct('type', 'i') %input layer struct('type', 'c', 'outputmaps', 6, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %sub sampling layer struct('type', 'c', 'outputmaps', 12, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %subsampling layer};cnn = cnnsetup(cnn, train_x, train_y);opts.alpha = 1;opts.batchsize = 50;opts.numepochs = 1;cnn = cnntrain(cnn, train_x, train_y, opts);[er, bad] = cnntest(cnn, test_x, test_y);%plot mean squared errorfigure; plot(cnn.rL);assert(er<0.12, 'Too big error');```Example: Neural Networks---------------------```matlabfunction test_example_NNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);% normalize[train_x, mu, sigma] = zscore(train_x);test_x = normalize(test_x, mu, sigma);%% ex1 vanilla neural netrand('state',0)nn = nnsetup([784 100 10]);opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samples[nn, L] = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.08, 'Too big error');%% ex2 neural net with L2 weight decayrand('state',0)nn = nnsetup([784 100 10]);nn.weightPenaltyL2 = 1e-4; % L2 weight decayopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex3 neural net with dropoutrand('state',0)nn = nnsetup([784 100 10]);nn.dropoutFraction = 0.5; % Dropout fraction opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex4 neural net with sigmoid activation functionrand('state',0)nn = nnsetup([784 100 10]);nn.activation_function = 'sigm'; % Sigmoid activation functionnn.learningRate = 1; % Sigm require a lower learning rateopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex5 plotting functionalityrand('state',0)nn = nnsetup([784 20 10]);opts.numepochs = 5; % Number of full sweeps through datann.output = 'softmax'; % use softmax outputopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex6 neural net with sigmoid activation and plotting of validation and training error% split training data into training and validation datavx = train_x(1:10000,:);tx = train_x(10001:end,:);vy = train_y(1:10000,:);ty = train_y(10001:end,:);rand('state',0)nn = nnsetup([784 20 10]); nn.output = 'softmax'; % use softmax outputopts.numepochs = 5; % Number of full sweeps through dataopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, tx, ty, opts, vx, vy); % nntrain takes validation set as last two arguments (optionally)[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');```[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/rasmusbergpalm/deeplearntoolbox/trend.png)](https://bitdeli.com/free "Bitdeli Badge")

C++中字符串的复制和拼接(针对C-风格字符串)

一、简述 在头文件<cstring>中,有两个函数strcpy()和strcat()。 二、详细介绍 他们各自的作用如下: 1.strcpy() 复制字符串。格式为 strcpy(char *Destination, const char *Source),由此可见,其接受两个 char * 参数。 例如: strcpy(full_name, first_name); //将 first_name 复制给 full_name —→ 其作用是将 first_name 数组中的字符串 复制给

坚持才能放假的博客 4412

Data-Structures-and-Algorithm-Analysis-in-Java.pdf

作者: Weiss, Mark A. 出版社: Addison Wesley Data Structures and Algorithm Analysis in Java is an “advanced algorithms” book that fits between traditional CS2 and Algorithms Analysis courses. In the old ACM Curriculum Guidelines, this course was known as CS7. This text is for readers who want to learn good programming and algorithm analysis skills simultaneously so that they can develop such programs with the maximum amo...

java如何把姓后面的名字加密

我整理的一些关于【算法,Java】的项目学习资料(附讲解~~)和大家一起分享、学习一下:https://d.51cto.com/bLN8S1在Java中如何对姓后面的名字进行加密 在现代应用中,保护用户的个人信息尤为重要。特别是姓名等敏感信息,往往需要进行加密处理。本文将介绍如何在Java中将姓后面的名字进行加密,具体步...

weixin_36127981的博客 231

jre9下载 jdk9

(Java SE Runtime Environment 9.0) 9.0u175 官方最新版 【x86|x64】

NTscan扫描工具

ntscan是一个扫描器,可以扫描没有密码和弱密码的共享,先到配置文件中填写猜测的用户名和密码,扫描过程中右侧出现的是扫描日志。

C Primer Plus第四章编程练习答案

学完C语言之后,我就去阅读《C Primer Plus》这本经典的C语言书籍,对每一章的编程练习题都做了相关的解答,仅仅代表着我个人的解答思路,如有错误,请各位大佬帮忙点出!d.在比姓名宽度宽3的字段中打印名和姓。

sakura0908的博客 1093

冰岛人【不会写】

7-11 冰岛人 (25分) 2018年世界杯,冰岛队因1:1平了强大的阿根廷队而一战成名。好事者发现冰岛人的名字后面似乎都有个“松”(son),于是有网友科普如下: 冰岛人沿用的是维京人古老的父系姓制,孩子的姓等于父亲的名加后缀,如果是儿子就加 sson,女儿则加 sdottir。因为冰岛人口较少,为避免近亲繁衍,本地人交往前先用个 App 查一下两人祖宗若干代有无联系。本题就请你实现这个 App 的功能。 输入格式: 输入首先在第一行给出一个正整数 N(1<N≤10e​5​​ ),为当地人口数。

WR的博客 313

C语言:编写一个程序,输入用户的姓名和电话号码,按姓名的词典顺序排序后,输出用户的姓和电话号码;

/*编写一个程序,输入用户的姓名和电话号码,按姓名的词典顺序排序后, 输出用户的姓和电话号码;*/ #include <stdio.h> #include <string.h> #define N 5 struct user //定义用户信息结构体 { char name[20]; char num[20]; }; //函数声明 void input (struct...

小七月的博客 1万+

c语言输入姓名输出姓和名_C输入和输出

c语言输入姓名输出姓和名 C输入和输出 (C Input and Output) Input means to provide the program with some data to be used in the program and Output means to display data on screen or write the data to a printer or a fil...

cunfen6312的博客 1万+

chatgpt赋能python:Python如何提取姓名中的姓和名

在很多国家和地区,姓名的构成都是由姓和名两部分组成。其中,姓氏通常是家族的名字,可以反映家族的起源、历史、职业等信息。而名字则可以包含个人的喜好、身份、经历等因素。因此,从姓名中提取出姓和名,可以为后续的语言处理、文本分析等任务提供更准确、有效的信息。本文由chatgpt生成,文章没有在chatgpt生成的基础上进行任何的修改。以上只是chatgpt能力的冰山一角。作为通用的Aigc大模型,只是展现它原本的实力。对于颠覆工作方式的ChatGPT,应该选择拥抱而不是抗拒,未来属于“会用”AI的人。

sc17332889342的博客 3669

python输出姓和名_分开名、中名和姓(Python)

这个完整的测试脚本怎么样:import sysdef process(file):for line in file:arr = line.split()if not arr:continuelast = arr.pop()n = len(arr)if n == 4:first, middle = ' '.join(arr[:2]), ' '.join(arr[2:])elif n == 3:if ...

weixin_39614109的博客 3536

C语言·编写程序输入名和姓,然后输出“名,姓”。

题目:编写一个程序,提示用户输入名和姓,然后以“名,姓”的格式打印出来。 #include<stdio.h> int main(void) { char last_name[30];/*可自行更改数据要占用的字符*/ char fast_name[30];/*可自行更改数据要占用的字符*/ printf("请分别输入您的名和姓,并用空格间隔开。\n"); scanf("%s"...

3Y的太空充电站 1万+

java 分别输出姓和名_用java输出姓名和学号 编程输出学号和名字 java语言

java输出学生学号,姓名,成绩设某一个班共有N(N=20)名学生,期末考试5门课程,请编一程序评定学生public class Student { private int kemu1, kemu2, kemu3, kemu4, kemu5; public int getKemu1() { return kemu1; } public void setKemu1(int kemu1) { this...

weixin_33796891的博客 2万+

java输入名字和语句_java编程一个输入名字,使得可以输出区分姓和名

展开全部帮你写了一个,实现基e5a48de588b662616964757a686964616f31333332643961本功能,加了一点基本的输入错误判断。需要其他更细节的部分可以自己完成。importjava.util.Scanner;publicclassTest{publicstaticvoidmain(Stringargs[]){Stringsurname[]=...

weixin_35724224的博客 2648
上一篇: 异常处理优劣观
下一篇: 我的Java阶段项目1 - 骑士飞行棋[两人对战][固定地图版]
CodingMouse
博客等级 码龄19年 82粉丝 48原创
评论 1
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值