我正在使用java swing工作计算器,我希望能够通过键盘输入数字和操作.我似乎无法让它工作.
import java.awt.*;
import javax.swing.*;
import java.awt.event.*;
public class Calculator extends JFrame implements ActionListener {
JPanel[] row = new JPanel[6];
JButton[] button = new JButton[23];
JMenuBar menubar = new JMenuBar();
JMenu file = new JMenu("File");
JMenuItem clear = new JMenuItem("Clear");
JMenuItem exit = new JMenuItem("Exit");
String[] buttonString = {"7", "8", "9", "+",
"4", "5", "6", "-",
"1", "2", "3", "*",
".", "/", "C", "?",
"+/-", "=", "0", "mod", "x^2", "x^y", "?"};
int[] dimW = {300,45,100,90};
int[] dimH = {35, …Run Code Online (Sandbox Code Playgroud) 无论我做什么,我都无法在循环工作时得到这个; 除非我硬编码.
count = 0
value = raw_input('How many?')
print value
while (count <= value):
print "a"
count= count + 1
Run Code Online (Sandbox Code Playgroud)
起初我尝试使用命令行参数,使用sys.argv [1]作为值,但我遇到了同样的问题.这看起来很简单,但我不能为我的生活弄清楚我做错了什么.
我正在写一个简单的C程序,我应该用缓冲区溢出来攻击.所以,我不希望在编译时使用任何标志.如何消除使用的默认标志?
# readelf -p .GCC.command.line stack
String dump of section '.GCC.command.line':
[ 0] stack.c
[ 8] -D_FORTIFY_SOURCE=2
[ 1c] -mtune=generic
[ 2b] -march=i486
[ 37] -frecord-gcc-switches
[ 4d] -fstack-protector
Run Code Online (Sandbox Code Playgroud)