- iOS/Objective-C 元类和类别
- objective-c - -1001 错误,当 NSURLSession 通过 httpproxy 和/etc/hosts
- java - 使用网络类获取 url 地址
- ios - 推送通知中不播放声音
我的代码有问题,我无法弄清楚问题出在哪里我已经尝试了所有的方法和可能的修改,但都是徒劳的
例如:
输入为2:
正常输出:
2 2 2
2 1 2
2 2 2
我的代码输出
2 2 2
2 1 2
2 2 2
这没问题
输入是5:
正常输出:
5 5 5 5 5 5 5 5 5
5 4 4 4 4 4 4 4 5
5 4 3 3 3 3 3 4 5
5 4 3 2 2 2 3 4 5
5 4 3 2 1 2 3 4 5
5 4 3 2 2 2 3 4 5
5 4 3 3 3 3 3 4 5
5 4 4 4 4 4 4 4 5
5 5 5 5 5 5 5 5 5
我的代码输出:
5 5 5 5 5 5 5 5 5
5 4 4 4 4 4 4 4 5
5 4 3 3 3 3 3 4 5
5 4 3 2 2 2 3 4 5
5 4 3 2 1 2 3 4 5
5 4 3 2 2 2 3 4 5
5 4 3 3 3 3 3 4 5
5 4 4 4 4 4 4 4 5
5 5 5 5 5 5 5 5 540352565
Segmentation fault (core dumped)
这不行:s
我不明白为什么这个 540352565
出现在我数组的 8x8 字段中还有 Segmentation fault (core dumped)
是由 free 引起的,我认为它与神秘数字 540352565
如果有人能帮我解决这个问题,我将不胜感激:p
这是我的代码:
#include <stdio.h>
#include <string.h>
#include <math.h>
#include <stdlib.h>
int main()
{
int n,fs,fe,i,j,nt;
int** pattern = NULL;
scanf("%d", &n);
nt = n+(n-1);//number of line
// Allocating memory
pattern=malloc( nt * sizeof(int*));
for(i=0;i<nt;i++) pattern[i] = malloc(sizeof(int));
printf("Start\n");
// filling pointer with data
for(fs=0,fe=nt-1;fs != fe;fs++,fe--){//where to write
for(i=fs;i<=fe;i++){
printf("n=%d,nt=%d,i=%d,fs=%d,fe=%d\n",n,nt,i,fs,fe);
pattern[fs][i] = n; // line 1
pattern[fe][i] = n; // line 2
pattern[i][fs] = n; // line 1
pattern[i][fe] = n; // line 2
}
n--;
}
pattern[nt/2][nt/2] = 1; // the central element
//printing pattern
for(i=0;i<nt;i++){
for (j=0; j<nt; j++)
printf("%d ",pattern[i][j]);
printf("\n");
}
//desallocating memory
for(i=0;i<nt;i++) free(pattern[i]);
free(pattern);
return 0;
}
这是执行内存检查的 valgrind 的输出
==13198== Memcheck, a memory error detector
==13198== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al.
==13198== Using Valgrind-3.13.0 and LibVEX; rerun with -h for copyright info
==13198== Command: ./main 2
==13198==
--13198-- Valgrind options:
--13198-- -v
--13198-- Contents of /proc/version:
--13198-- Linux version 4.15.0-45-generic (buildd@lgw01-amd64-031) (gcc version 7.3.0 (Ubuntu 7.3.0-16ubuntu3)) #48-Ubuntu SMP Tue Jan 29 16:28:13 UTC 2019
--13198--
--13198-- Arch and hwcaps: AMD64, LittleEndian, amd64-cx16-rdtscp-sse3-avx
--13198-- Page sizes: currently 4096, max supported 4096
--13198-- Valgrind library directory: /usr/lib/valgrind
--13198-- Reading syms from /home/aminejow/exercism_files/c/pattern/main
--13198-- Reading syms from /lib/x86_64-linux-gnu/ld-2.27.so
--13198-- Considering /lib/x86_64-linux-gnu/ld-2.27.so ..
--13198-- .. CRC mismatch (computed 1b7c895e wanted 2943108a)
--13198-- Considering /usr/lib/debug/lib/x86_64-linux-gnu/ld-2.27.so ..
--13198-- .. CRC is valid
--13198-- Reading syms from /usr/lib/valgrind/memcheck-amd64-linux
--13198-- Considering /usr/lib/valgrind/memcheck-amd64-linux ..
--13198-- .. CRC mismatch (computed c25f395c wanted 0a9602a8)
--13198-- object doesn't have a symbol table
--13198-- object doesn't have a dynamic symbol table
--13198-- Scheduler: using generic scheduler lock implementation.
--13198-- Reading suppressions file: /usr/lib/valgrind/default.supp
==13198== embedded gdbserver: reading from /tmp/vgdb-pipe-from-vgdb-to-13198-by-aminejow-on-???
==13198== embedded gdbserver: writing to /tmp/vgdb-pipe-to-vgdb-from-13198-by-aminejow-on-???
==13198== embedded gdbserver: shared mem /tmp/vgdb-pipe-shared-mem-vgdb-13198-by-aminejow-on-???
==13198==
==13198== TO CONTROL THIS PROCESS USING vgdb (which you probably
==13198== don't want to do, unless you know exactly what you're doing,
==13198== or are doing some strange experiment):
==13198== /usr/lib/valgrind/../../bin/vgdb --pid=13198 ...command...
==13198==
==13198== TO DEBUG THIS PROCESS USING GDB: start GDB like this
==13198== /path/to/gdb ./main
==13198== and then give GDB the following command
==13198== target remote | /usr/lib/valgrind/../../bin/vgdb --pid=13198
==13198== --pid is optional if only one valgrind process is running
==13198==
--13198-- REDIR: 0x401f2f0 (ld-linux-x86-64.so.2:strlen) redirected to 0x58060901 (???)
--13198-- REDIR: 0x401f0d0 (ld-linux-x86-64.so.2:index) redirected to 0x5806091b (???)
--13198-- Reading syms from /usr/lib/valgrind/vgpreload_core-amd64-linux.so
--13198-- Considering /usr/lib/valgrind/vgpreload_core-amd64-linux.so ..
--13198-- .. CRC mismatch (computed 4b63d83e wanted 670599e6)
--13198-- object doesn't have a symbol table
--13198-- Reading syms from /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so
--13198-- Considering /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so ..
--13198-- .. CRC mismatch (computed a4b37bee wanted 8ad4dc94)
--13198-- object doesn't have a symbol table
==13198== WARNING: new redirection conflicts with existing -- ignoring it
--13198-- old: 0x0401f2f0 (strlen ) R-> (0000.0) 0x58060901 ???
--13198-- new: 0x0401f2f0 (strlen ) R-> (2007.0) 0x04c32db0 strlen
--13198-- REDIR: 0x401d360 (ld-linux-x86-64.so.2:strcmp) redirected to 0x4c33ee0 (strcmp)
--13198-- REDIR: 0x401f830 (ld-linux-x86-64.so.2:mempcpy) redirected to 0x4c374f0 (mempcpy)
--13198-- Reading syms from /lib/x86_64-linux-gnu/libc-2.27.so
--13198-- Considering /lib/x86_64-linux-gnu/libc-2.27.so ..
--13198-- .. CRC mismatch (computed b1c74187 wanted 042cc048)
--13198-- Considering /usr/lib/debug/lib/x86_64-linux-gnu/libc-2.27.so ..
--13198-- .. CRC is valid
--13198-- REDIR: 0x4edac70 (libc.so.6:memmove) redirected to 0x4a2a6e0 (_vgnU_ifunc_wrapper)
--13198-- REDIR: 0x4ed9d40 (libc.so.6:strncpy) redirected to 0x4a2a6e0 (_vgnU_ifunc_wrapper)
--13198-- REDIR: 0x4edaf50 (libc.so.6:strcasecmp) redirected to 0x4a2a6e0 (_vgnU_ifunc_wrapper)
--13198-- REDIR: 0x4ed9790 (libc.so.6:strcat) redirected to 0x4a2a6e0 (_vgnU_ifunc_wrapper)
--13198-- REDIR: 0x4ed9d70 (libc.so.6:rindex) redirected to 0x4a2a6e0 (_vgnU_ifunc_wrapper)
--13198-- REDIR: 0x4edc7c0 (libc.so.6:rawmemchr) redirected to 0x4a2a6e0 (_vgnU_ifunc_wrapper)
--13198-- REDIR: 0x4edade0 (libc.so.6:mempcpy) redirected to 0x4a2a6e0 (_vgnU_ifunc_wrapper)
--13198-- REDIR: 0x4edac10 (libc.so.6:bcmp) redirected to 0x4a2a6e0 (_vgnU_ifunc_wrapper)
--13198-- REDIR: 0x4ed9d00 (libc.so.6:strncmp) redirected to 0x4a2a6e0 (_vgnU_ifunc_wrapper)
--13198-- REDIR: 0x4ed9800 (libc.so.6:strcmp) redirected to 0x4a2a6e0 (_vgnU_ifunc_wrapper)
--13198-- REDIR: 0x4edad40 (libc.so.6:memset) redirected to 0x4a2a6e0 (_vgnU_ifunc_wrapper)
--13198-- REDIR: 0x4ef80f0 (libc.so.6:wcschr) redirected to 0x4a2a6e0 (_vgnU_ifunc_wrapper)
--13198-- REDIR: 0x4ed9ca0 (libc.so.6:strnlen) redirected to 0x4a2a6e0 (_vgnU_ifunc_wrapper)
--13198-- REDIR: 0x4ed9870 (libc.so.6:strcspn) redirected to 0x4a2a6e0 (_vgnU_ifunc_wrapper)
--13198-- REDIR: 0x4edafa0 (libc.so.6:strncasecmp) redirected to 0x4a2a6e0 (_vgnU_ifunc_wrapper)
--13198-- REDIR: 0x4ed9840 (libc.so.6:strcpy) redirected to 0x4a2a6e0 (_vgnU_ifunc_wrapper)
--13198-- REDIR: 0x4edb0e0 (libc.so.6:memcpy@@GLIBC_2.14) redirected to 0x4a2a6e0 (_vgnU_ifunc_wrapper)
--13198-- REDIR: 0x4ed9da0 (libc.so.6:strpbrk) redirected to 0x4a2a6e0 (_vgnU_ifunc_wrapper)
--13198-- REDIR: 0x4ed97c0 (libc.so.6:index) redirected to 0x4a2a6e0 (_vgnU_ifunc_wrapper)
--13198-- REDIR: 0x4ed9c70 (libc.so.6:strlen) redirected to 0x4a2a6e0 (_vgnU_ifunc_wrapper)
--13198-- REDIR: 0x4ee46c0 (libc.so.6:memrchr) redirected to 0x4a2a6e0 (_vgnU_ifunc_wrapper)
--13198-- REDIR: 0x4edaff0 (libc.so.6:strcasecmp_l) redirected to 0x4a2a6e0 (_vgnU_ifunc_wrapper)
--13198-- REDIR: 0x4edabe0 (libc.so.6:memchr) redirected to 0x4a2a6e0 (_vgnU_ifunc_wrapper)
--13198-- REDIR: 0x4ef8eb0 (libc.so.6:wcslen) redirected to 0x4a2a6e0 (_vgnU_ifunc_wrapper)
--13198-- REDIR: 0x4eda050 (libc.so.6:strspn) redirected to 0x4a2a6e0 (_vgnU_ifunc_wrapper)
--13198-- REDIR: 0x4edaf20 (libc.so.6:stpncpy) redirected to 0x4a2a6e0 (_vgnU_ifunc_wrapper)
--13198-- REDIR: 0x4edaef0 (libc.so.6:stpcpy) redirected to 0x4a2a6e0 (_vgnU_ifunc_wrapper)
--13198-- REDIR: 0x4edc7f0 (libc.so.6:strchrnul) redirected to 0x4a2a6e0 (_vgnU_ifunc_wrapper)
--13198-- REDIR: 0x4edb040 (libc.so.6:strncasecmp_l) redirected to 0x4a2a6e0 (_vgnU_ifunc_wrapper)
--13198-- REDIR: 0x4eed330 (libc.so.6:__strrchr_sse2) redirected to 0x4c32790 (__strrchr_sse2)
--13198-- REDIR: 0x4ed3070 (libc.so.6:malloc) redirected to 0x4c2faa0 (malloc)
--13198-- REDIR: 0x4eed620 (libc.so.6:__strlen_sse2) redirected to 0x4c32d30 (__strlen_sse2)
--13198-- REDIR: 0x4eed120 (libc.so.6:__strchrnul_sse2) redirected to 0x4c37020 (strchrnul)
--13198-- REDIR: 0x4ef7440 (libc.so.6:__mempcpy_sse2_unaligned) redirected to 0x4c37130 (mempcpy)
==13198== Invalid write of size 4
==13198== at 0x1089C2: main (in /home/aminejow/exercism_files/c/pattern/main)
==13198== Address 0x522d530 is 16 bytes after a block of size 16 in arena "client"
==13198==
==13198== Invalid write of size 4
==13198== at 0x108947: main (in /home/aminejow/exercism_files/c/pattern/main)
==13198== Address 0x522d514 is 0 bytes after a block of size 4 alloc'd
==13198== at 0x4C2FB0F: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==13198== by 0x1088BC: main (in /home/aminejow/exercism_files/c/pattern/main)
==13198==
==13198== Invalid write of size 4
==13198== at 0x108970: main (in /home/aminejow/exercism_files/c/pattern/main)
==13198== Address 0x522d794 is 0 bytes after a block of size 4 alloc'd
==13198== at 0x4C2FB0F: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==13198== by 0x1088BC: main (in /home/aminejow/exercism_files/c/pattern/main)
==13198==
==13198== Invalid write of size 4
==13198== at 0x108999: main (in /home/aminejow/exercism_files/c/pattern/main)
==13198== Address 0x522d564 is 0 bytes after a block of size 4 alloc'd
==13198== at 0x4C2FB0F: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==13198== by 0x1088BC: main (in /home/aminejow/exercism_files/c/pattern/main)
==13198==
==13198== Invalid write of size 4
==13198== at 0x108A26: main (in /home/aminejow/exercism_files/c/pattern/main)
==13198== Address 0x522d660 is 12 bytes after a block of size 4 alloc'd
==13198== at 0x4C2FB0F: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==13198== by 0x1088BC: main (in /home/aminejow/exercism_files/c/pattern/main)
==13198==
==13198== Invalid read of size 4
==13198== at 0x108A62: main (in /home/aminejow/exercism_files/c/pattern/main)
==13198== Address 0x522d514 is 0 bytes after a block of size 4 alloc'd
==13198== at 0x4C2FB0F: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==13198== by 0x1088BC: main (in /home/aminejow/exercism_files/c/pattern/main)
==13198==
--13198-- REDIR: 0x4ed3950 (libc.so.6:free) redirected to 0x4c30cd0 (free)
Start
n=5,nt=9,i=0,fs=0,fe=8
n=5,nt=9,i=1,fs=0,fe=8
n=5,nt=9,i=2,fs=0,fe=8
n=5,nt=9,i=3,fs=0,fe=8
n=5,nt=9,i=4,fs=0,fe=8
n=5,nt=9,i=5,fs=0,fe=8
n=5,nt=9,i=6,fs=0,fe=8
n=5,nt=9,i=7,fs=0,fe=8
n=5,nt=9,i=8,fs=0,fe=8
n=4,nt=9,i=1,fs=1,fe=7
n=4,nt=9,i=2,fs=1,fe=7
n=4,nt=9,i=3,fs=1,fe=7
n=4,nt=9,i=4,fs=1,fe=7
n=4,nt=9,i=5,fs=1,fe=7
n=4,nt=9,i=6,fs=1,fe=7
n=4,nt=9,i=7,fs=1,fe=7
n=3,nt=9,i=2,fs=2,fe=6
n=3,nt=9,i=3,fs=2,fe=6
n=3,nt=9,i=4,fs=2,fe=6
n=3,nt=9,i=5,fs=2,fe=6
n=3,nt=9,i=6,fs=2,fe=6
n=2,nt=9,i=3,fs=3,fe=5
n=2,nt=9,i=4,fs=3,fe=5
n=2,nt=9,i=5,fs=3,fe=5
5 5 5 5 5 5 5 5 5
5 4 4 4 4 4 4 4 5
5 4 3 3 3 3 3 4 5
5 4 3 2 2 2 3 4 5
5 4 3 2 1 2 3 4 5
5 4 3 2 2 2 3 4 5
5 4 3 3 3 3 3 4 5
5 4 4 4 4 4 4 4 5
5 5 5 5 5 5 5 5 5
==13198==
==13198== HEAP SUMMARY:
==13198== in use at exit: 0 bytes in 0 blocks
==13198== total heap usage: 12 allocs, 12 frees, 5,228 bytes allocated
==13198==
==13198== All heap blocks were freed -- no leaks are possible
==13198==
==13198== ERROR SUMMARY: 158 errors from 6 contexts (suppressed: 0 from 0)
==13198==
==13198== 1 errors in context 1 of 6:
==13198== Invalid write of size 4
==13198== at 0x108A26: main (in /home/aminejow/exercism_files/c/pattern/main)
==13198== Address 0x522d660 is 12 bytes after a block of size 4 alloc'd
==13198== at 0x4C2FB0F: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==13198== by 0x1088BC: main (in /home/aminejow/exercism_files/c/pattern/main)
==13198==
==13198==
==13198== 15 errors in context 2 of 6:
==13198== Invalid write of size 4
==13198== at 0x108999: main (in /home/aminejow/exercism_files/c/pattern/main)
==13198== Address 0x522d564 is 0 bytes after a block of size 4 alloc'd
==13198== at 0x4C2FB0F: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==13198== by 0x1088BC: main (in /home/aminejow/exercism_files/c/pattern/main)
==13198==
==13198==
==13198== 23 errors in context 3 of 6:
==13198== Invalid write of size 4
==13198== at 0x108970: main (in /home/aminejow/exercism_files/c/pattern/main)
==13198== Address 0x522d794 is 0 bytes after a block of size 4 alloc'd
==13198== at 0x4C2FB0F: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==13198== by 0x1088BC: main (in /home/aminejow/exercism_files/c/pattern/main)
==13198==
==13198==
==13198== 23 errors in context 4 of 6:
==13198== Invalid write of size 4
==13198== at 0x108947: main (in /home/aminejow/exercism_files/c/pattern/main)
==13198== Address 0x522d514 is 0 bytes after a block of size 4 alloc'd
==13198== at 0x4C2FB0F: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==13198== by 0x1088BC: main (in /home/aminejow/exercism_files/c/pattern/main)
==13198==
==13198==
==13198== 24 errors in context 5 of 6:
==13198== Invalid write of size 4
==13198== at 0x1089C2: main (in /home/aminejow/exercism_files/c/pattern/main)
==13198== Address 0x522d530 is 16 bytes after a block of size 16 in arena "client"
==13198==
==13198==
==13198== 72 errors in context 6 of 6:
==13198== Invalid read of size 4
==13198== at 0x108A62: main (in /home/aminejow/exercism_files/c/pattern/main)
==13198== Address 0x522d514 is 0 bytes after a block of size 4 alloc'd
==13198== at 0x4C2FB0F: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==13198== by 0x1088BC: main (in /home/aminejow/exercism_files/c/pattern/main)
==13198==
==13198== ERROR SUMMARY: 158 errors from 6 contexts (suppressed: 0 from 0)
最佳答案
您没有为每一行分配足够的内存:
for(i=0;i<nt;i++) pattern[i] = malloc(sizeof(int));
在这里,您只为一个 int
分配空间。您需要 nt
个:
for(i=0;i<nt;i++) pattern[i] = malloc(nt * sizeof(int));
关于c - 使用指针打印图案时出现问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55012685/
我正在使用自定义的 uitableviewcell,并尝试重新创建一张活页纸作为背景。由于每个单元格都会根据文本量而增长,因此我需要为每个单元格的背景使用一个图案。但我对这些黑线有疑问,这让我发疯!
我已经解决这个问题 2 个小时了,似乎无法弄清楚如何按模式计数。 图案: 1-1-1 1-1-2 1-2-1 1-2-2 2-1-1 2-1-2 2-2-1 2-2-2 等等…… 最佳答案 我认为最简
我想尝试创建一个学习象棋应用程序作为学校项目。我的第一个计划是简单地让这个人工智能与自己进行较量,但要真正展示它是否成功,它需要能够展示它的进展情况。为了做到这一点,我希望它能够在 chess.com
已关闭。此问题不符合Stack Overflow guidelines 。目前不接受答案。 这个问题似乎偏离主题,因为它缺乏足够的信息来诊断问题。 更详细地描述您的问题或 include a mini
以下函数返回什么? (就意义而言) int f(int n){ if(n == 0) return 0; else return n % 2 + f(n / 2) } 尝试运行代码,但
我有一个专栏A3:A71我希望填充值 =COUNTIF(B3:B71,B3) 第二个参数随每个单元格递增。 显然我不想每次都复制这个函数,所以我希望填充句柄能帮助我。然而,尽管它正确地增加了 COUN
我需要重复 svg 在水平方向 . 我的意思是,svg 比图案大,所以我需要它在剩下的任何空间上水平重复。 我希望主要图案出现在中心,这正是现在正在发生的事情。我只需要让它在两边都重复。 现在,我只
我需要重复 svg 在水平方向 . 我的意思是,svg 比图案大,所以我需要它在剩下的任何空间上水平重复。 我希望主要图案出现在中心,这正是现在正在发生的事情。我只需要让它在两边都重复。 现在,我只
请帮我完成作业。我想使用循环 C 语言生成这样的模式 X X X XXX XXXXX XXX X X X XXXXX X X X X X X XXXXX X XX X X X X X
c# 3.0 为我们提供了带有编译器生成的支持字段的 getter 和 setter - 这真的很棒,但很多时候您仍然需要使用支持字段。 在一个完美的世界(意见)中,你可以做类似的事情 class M
我正在创建一个 wordpress 主题,我正在尝试创建一个导航栏,其中每个 li 都有不同的背景颜色(例如,红色,然后是绿色,然后是蓝色)。然后在使用前三种颜色后,它会再次重复使用。 例如:
是否可以将 .svg 图案作为背景图像,svg 图案应调整为窗口宽度和高度。 最佳答案 这是可能的,但浏览器支持有限。 Webkit 往往具有最好的 SVG 支持,而 IE 最差。您可以使用 CSS
如何打印反Z图案? 普通 Z 模式的代码: int main() { int n; printf("Enter number of rows: "); scanf("%d", &n); for (in
我的图片中有重复的图案。我想根据相似的模式找到相似的图像。 图案由十字形、三角形、正方形组成,它们组合在一起形成由这些“原始形状”构成的更复杂的结构。例如,想象一个由三角形或六边形等组成的十字架。 这
是否可以在 SVG 填充中模拟以下 CSS? background-image: url(/* URL */); background-position: 50%; background-size:
这个问题在这里已经有了答案: How to make SVG image pattern fill move with object? (4 个答案) 关闭 1 年前。 我创建了这里看到的 svg
问题:存在关联键的表列表。有必要为每个表实现 CRUD + 一些关于表细节的功能(分页等)。麻烦:在每个表的每个功能实现中重复了大约 50% 的代码。问题:关于语言细节、优化/重构/使用类似代码模式的
尝试绘制在 x 轴上重复的背景。然而,图像放错了位置,当我调整窗口大小时,位于图案中的 View 将开始“移动”。 我做错了什么?目前正在做以下工作: [[NSColor colorWithPatte
Javascript 问题。 关于模式或表达,可能是重复的问题。 您可以使用下面的三个来获得一个对象。结果对象的工作原理相同。 当您使用繁重的 JavaScript Web 应用程序时,哪种模式最好?
是否可以使用 CSS 创建以下效果。我在 HTML 中只有一个 H2 元素,我对页面的 HTML 没有任何控制。我只能更改 CSS。 我用 :before 和 :after 尝试过,但到目前为止没有成
我是一名优秀的程序员,十分优秀!