#include<stdio.h> #include <string.h> int main() { int n, m; scanf("%d %d", &n, &m); char str_n[20], str_m[20]; sprintf(str_n, "%d", n); sprintf(str_m, "%d", m); int count_n[10] = {0}; int count_m[10] = {0}; for (int i = 0; i < strlen(str_n); i++) { count_n[str_n[i] - '0']++; } for (int i = 0; i < strlen(str_m); i++) { count_m[str_m[i] - '0']++; } int unique_n = 0, unique_m = 0; for (int i = 0; i < 10; i++) { if (count_n[i] > 0) unique_n++; if (count_m[i] > 0) unique_m++; } if (unique_n >


It seems like the code you provided is incomplete and has been cut off at the end. However, I can help you complete it based on what you have so far. The code appears to be counting the number of unique digits in two integers `n` and `m`. The counts are stored in arrays `count_n` and `count_m`, respectively. Then, the number of unique digits for each integer is calculated by checking how many elements in these arrays are greater than zero. To complete the code, you need to decide what you want to do with the counts of unique digits. For example, you might want to print them out, compare them, or use them in some other way. Here's an example of how you could print out the number of unique digits for both `n` and `m`: ```c #include<stdio.h> #include <string.h> int main() { int n, m; scanf("%d %d", &n, &m); char str_n[20], str_m[20]; sprintf(str_n, "%d", n); sprintf(str_m, "%d", m); int count_n[10] = {0}; int count_m[10] = {0}; for (int i = 0; i < strlen(str_n); i++) { count_n[str_n[i] - '0']++; } for (int i = 0; i < strlen(str_m); i++) { count_m[str_m[i] - '0']++; } int unique_n = 0, unique_m = 0; for (int i = 0; i < 10; i++) { if (count_n[i] > 0) unique_n++; if (count_m[i] > 0) unique_m++; } printf("Number of unique digits in %d: %d\n", n, unique_n); printf("Number of unique digits in %d: %d\n", m, unique_m); return 0; } ``` This code will print out the number of unique digits in both `n` and `m`. If you had a different requirement in mind, please provide more details so that I can assist you further. [2024-10-18 11:48:35 | AI写代码神器 | 566点数解答]
- #include<stdio.h> #include <string.h> int main() { int n, m; scanf("%d %d", &n, &m); char str_n[20], str_m[20]; sprintf(str_n, "%d", n); sprintf(str_m, "%d", m); int count_n[10] = {0}; int count_m[10] = {0}; for (int i = 0; i < strlen(str_n); i++) { count_n[str_n[i] - '0']++; } for (int i = 0; i < strlen(str_m); i++) { count_m[str_m[i] - '0']++; } int unique_n = 0, unique_m = 0; for (int i = 0; i < 10; i++) { if (count_n[i] > 0) unique_n++; if (count_m[i] > 0) unique_m++; } if (unique_n >(566点数解答 | 2024-10-18 11:48:35)194
- #include<iostream> #include<complex.h> #include <complex> #include <math.h> using namespace std; #define pi 3.14159265358979323846 int main() { file* stream; stream = fopen("4000-red.raw","rb"); unsigned char* image = (unsigned char*)malloc(4000 * 4000 * sizeof(unsigned char)); fread(image,4000*4000,sizeof(unsigned char),stream); unsigned char* image2 = (unsigned char*)malloc(4000 * 4000 * sizeof(unsigned char)); unsigned char* image3 = (unsigned char*)malloc(4000 * 4000 * sizeof(unsigned(413点数解答 | 2024-11-02 18:16:35)219
- 检查代码 #include <ctype.h> #include <string.h> void verse(char* str) { *str = tolower(*str); int lens = strlen(str); printf("字符串长度为:%d\n", lens); for (int i = 0; i < lens / 2; i++) { char temp = str[i]; str[i] = str[lens - 1 - i]; str[lens - 1 - i] = temp; } } int pali(char *str) { int lens=strlen(str); char *reverse[lens+1]; strcpy(reverse, str); verse(reverse); return strcmp(str, reverse)==0; } int main() { char str[101];(655点数解答 | 2024-11-08 21:54:45)189
- 采用c++语言,实现如下功能: 实现古典密码中的移位密码和仿射密码,具体实现如下接口: c++接口: <<<<<移位密码>>>>> bool is_valid_s(unsinged char k) { 判断k是否为合理的密钥 } int encrypt_s(unsigned char* p, unsigned char k) { 密钥合法则返回1,且密文覆盖明文: 密钥不合法则返回0. } int decrypt_s(unsigned char* c, unsigned char k) { 密钥合法则返回1,且明文覆盖密文: 密钥不合法则返回0. } <<<<<仿射密码>>>>> bool in_valid_a(unsinged char a, unsigned char b) { 判断a,b是否为合理的密钥 } int encrypt_a(unsigned char* p, unsigned char a, unsigned char b) { 密钥合法则返回1,且密文覆盖明文: 密钥不合法则返回0. } int decrypt_a(unsigned char* c, unsign(812点数解答 | 2024-12-18 16:02:36)251
- // // main.cpp // step1 // // created by ljpc on 2018/8/31. // copyright © 2018年 ljpc. all rights reserved. // #include <iostream> #include <stack> #include <cstring> #include <algorithm> using namespace std; int main(int argc, const char * argv[]) { // 请在这里补充代码,完成本关任务 /********* begin *********/ stack<char> s1; stack<char> s2; char s[200]; fgets(s,200,stdin); int len=strlen(s); if(s[len-1]=='\n'){ s[len-1]='\0'; len--; } char(518点数解答 | 2024-10-25 17:28:04)158
- 解释下列代码 #include <stdio.h> #include <string.h> // 定义排序字符串的函数 void sortstring(char *a, char *b) { int len = strlen(a); strcpy(b, a); // 先将 a 的内容复制到 b 中 // 使用冒泡排序对字符串进行排序 for (int i = 0; i < len - 1; i++) { for (int j = 0; j < len - i - 1; j++) { if (b[j] > b[j + 1]) { // 交换 b[j] 和 b[j + 1] char temp = b[j]; b[j] = b[j + 1]; b[j + 1] = temp; } } } } int main() { char a[(1092点数解答 | 2024-11-27 08:08:34)131
- 6-22 删除字符串中指定的字符 分数 10 作者 王跃萍 单位 东北石油大学 编写函数fun,函数的功能是:从字符串中删除指定的字符。同一字母的大、小写按不同字符处理。 函数接口定义: int fun(char s[],char c); 其中 s 和 c 都是用户传入的参数。 函数从字符串 s中删除指定的字符c 。同一字母的大、小写按不同字符处理。 裁判测试程序样例: #include <stdio.h> int fun(char s[],char c); int main() { static char str[]="turbocandborlandc++"; char ch; scanf("%c",&ch); printf("原始字符串:%s\n", str); fun(str,ch); printf("str[]=%s\n",str); return 0; } /* 请在这里填写答案 */ 输入样例: c 输出样例: 原始字符串:turbocandborlandc++ str[]=turboandborland(211点数解答 | 2025-01-21 21:18:10)182
- #include "stm32f10x.h" // 有问题和需求的,可以联系VX:lwfw********* #include <stdio.h> #include <string.h> #include "sys.h" #include "delay.h" #include "OLED.h" #include "dht11.h" //温湿度传感器 #include "Key.h" #include "jidianqi.h" #include "OLED.h" #include "Serial.h" #include "LED.h" #include "Buzzer.h" #include "Motor.h" #include "CountSensor.h" #include "AD.h" uint16_t AD0; //存储ADC的值 uint8_t KeyNum; //存储按键值 uint8_t RxData; //蓝牙接收到的数据 u8 temp, humi; //存储温湿度 float temp1; //(25点数解答 | 2025-05-06 01:13:43)100
- #include <iostream> #include <fstream> #include <vector> #include <string> #include <sstream> #include <stack> #include <map> #include <cctype> using namespace std; const string preamble = R"( .intel_syntax noprefix .globl main .extern printf .section .data format_str: .asciz "%d\n" .section .text main: push ebp mov ebp, esp sub esp, 208 )"; const string postamble = R"( mov eax, 0 mov esp, ebp pop ebp ret )"; struct Variable { char name; int offset; }; v(2430点数解答 | 2025-07-10 21:28:43)69
- #include <stdio.h> #include <stdlib.h> #include <malloc.h> #include <string.h> #include <stdbool.h> /* 学生管理系统 包括:学号(long long int),姓名(char[]),性别(char[]),年龄(int) 存储结构:顺序表 顺序表用动态内存分配实现创建,初始容量设置为1 主要功能: 1.学生信息的插入 尾部插入 插入到指定学号后面 插入到指定姓名后面 注意:需要输入 学号(long long int),姓名(char[]),性别(char[]),年龄(int) 学号必须输入且不能重复 2.学生信息删除 尾部删除 根据学号删除学生 根据姓名删除学生 3.修改学生信息 根据学号修改学生 根据姓名修改学生 4.查询学生信息 根据学号查询学生 根据姓名查询学生 文件存储(stuinfo.txt) 结束销毁顺序表 */ //创建学生结构 struct student { long long int id;//学号(2323点数解答 | 2024-11-01 02:41:20)203
- void sr(struct student* sr) //输入函数 显示器输入(录入学生信息) { int i = 0; printf("请输入学生的个数:"); scanf("%d", &d); system("cls");//清屏 for (; i < d; i++) { printf("请输入学生的姓名:"); scanf("%s", (*(sr + i)).name); printf("请输入学生的学号:"); scanf("%d", &(*(sr + i)).num); printf("请输入学生的语文成绩:"); scanf("%f", &(*(sr + i)).chinese); printf("请输入学生的数学成绩:"); scanf("%f", &(*(sr + i)).math); printf("请输入学生的英语成绩:"); scanf("%f", &(*(sr + i)).english); printf("请输入学生的计算机成绩:"); scanf("%f", &(*(sr + i)).c(5点数解答 | 2024-07-02 08:40:40)230
- 本题要实现的程序功能是: ①从键盘上先后读入两个不超过32个字符的字符串,存储在字符数组str1和str2中。②将字符串str2插入字符串str1中,在屏幕上输出新生成的str1。 函数接口定义: void conj(char *s1, char *s2); 裁判测试程序样例: #include <stdio.h> #include <string.h> #define n 32 void conj(char *s1, char *s2); int main(void) { char str1[n * 2], str2[n]; gets(str1); gets(str2); conj(str1, str2); printf("after conj string1:%s\n", str1); return 0; } /* 请在这里填写答案 */ 用c语言(212点数解答 | 2024-12-12 18:12:00)191