我希望能够更改我的应用程序的背景颜色,以便每当我想在运行时更改颜色时,我只需按下应用程序中的按钮即可更改背景颜色.在改变颜色之后,我希望每当我再次打开应用程序时它应该留在那里.此外,我想知道如何在我进行另一项活动时更改其他活动的颜色.提前致谢.我的colors.xml:
<resources>
<color name="original">#25383C</color>
<color name="grey">#484849</color>
<color name="red">#881A27</color>
<color name="orange">#ffa500</color>
<color name="yellow">#CDE707</color>
<color name="green">#00ff00</color>
<color name="aqua">#00FFCC</color>
<color name="marine">#0C0C84</color>
<color name="purple">#630A86</color>
<color name="silver">#c0c0c0</color>
Run Code Online (Sandbox Code Playgroud)
styles.xml(它有主题):
<resources>
<style name="original">
<item name="android:background">#25383C</item>
</style>
<style name="grey">
<item name="android:background">#484849</item>
</style>
<style name="red">
<item name="android:background">#881A27</item>
</style>
<style name="orange">
<item name="android:background">#ffa500</item>
</style>
<style name="yellow">
<item name="android:background">#CDE707</item>
</style>
<style name="green">
<item name="android:background">#00ff00</item>
</style>
<style name="aqua">
<item name="android:background">#00FFCC</item>
</style>
<style name="marine">
<item name="android:background">#0C0C84</item>
</style>
<style name="purple">
<item name="android:background">#630A86</item> …Run Code Online (Sandbox Code Playgroud) 我试图在codeforces上解决问题811C.我开始编写sublime-text编码,并设法在一段时间后提出解决方案.当我运行该程序时,它给了我正确的答案但是当我提交代码时,出于某种原因我得到了代码强制的不同答案.我检查了数组是否超出范围,但这似乎不是原因.这是代码:
/* Code Readability Credit : Max Vollmer */
#include <iostream>
#include <cstdio>
#include <string.h>
#include <algorithm>
#include <set>
// terms[] stores the value of all the terms. leftMosts[i] and rightMosts[i] store the leftmost and rightmost occurrences of the ith element in terms[].
//solvedValues[] stands for dynamic programming and stores the pre calculated terms of the function solve()
int numberOfTerms;
int terms[5005];
int leftMosts[5005];
int rightMosts[5005];
int solvedValues[5005];
int comf(int left,int right)// comf = …Run Code Online (Sandbox Code Playgroud)